Reputation: 1403
Here is the HTML:
<header>
<div class="image">
<img class="logo" src="https://www.gravatar.com/avatar/b637dcf2d1f68517a316c466585ea1a8?s=32&d=identicon&r=PG&f=1" />
</div>
<div class="form">
<input type="text" class="input" name="location" id="location" />
</div>
</header>
Here is the CSS:
.image {
float:left;
}
img {
width: 100px;
height: 100px;
}
.form {
vertical-align: middle;
}
Here is the jsfiddle link: http://jsfiddle.net/NmP69/1/
Upvotes: 0
Views: 80
Reputation: 808
One of the possible way of doing it is to use position absolute and negative margin on your image:
img {
width: 100px;
height: 100px;
position: absolute;
top: 50%;
margin-top: -50px;
}
See the result here: http://jsfiddle.net/WHSKL/
Upvotes: 0
Reputation: 15749
Here you go.
The CSS Change:
.form {
vertical-align: middle;
display:table-cell;
}
header {
display: table;
}
Hope this helps.
Upvotes: 2