I need to align the height of a button and a text box... How can I do it?
.round {
background-color: transparent;
width: auto;
height: auto;
margin: 0 auto 15px auto;
padding: 5px;
border: 1px solid silver;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
display: inline-block;
}
<div class="pull-right">
<form method="GET">
<div style="display: inline-block ;">
<input type="search" id="contractNumber" name="contractNumber" placeholder="Contract Number" class="round" />
<input type="image" src="~/images/Lupa.jpg" width="30" height="30" />
</div>
</form>
</div>
Now it looks like this, the text box and the image of the magnifying glass should be at the same height...
Remove the attributes
width="30" height="30"
of the secondinput
One thing you can do is give it an
vertical-align: middle
imageinput
type so that it aligns vertically with the middle of the line. That way it will align to the vertical center, it won't matter if the image is 30x30 or 20x20 or if it's bigger and you're scaling it (which seems to be your case).Here you can see it working (with a 300x300 image scaled to 30x30):