I would like to align my icon elements with the form inputs. This is what I have so far:
<div class="ctr">
<div class="icon-ctr">
<span class="icon"></span>
</div>
<input type="text" />
</div>
and the css:
.ctr {
font-size: 0;
}
.ctr input {
font-size: 14px;
line-height: 14px;
height: 14px;
width: 100px;
padding: 13px;
border: 1px solid #000;
}
.icon-ctr {
display: inline-block;
height: 16px;
padding: 12px;
border: 1px solid #000;
margin-right: -1px;
}
.icon {
display: inline-block;
height: 16px;
width: 16px;
background-color: #f00;
}
You'll notice that the elements don't align in a straight line as I had hoped. Firstly what property is causing this? And secondly what is the most appropriate way to align the elements in a straight line?
float: leftinstead ofdisplay: inline-blockthat they do line up correctly. Interesting that inline-block isn't working I'm going to check into that.