我在一个div中有一张图片和一段文字并排放置。我想要将文字垂直居中对齐,但它始终停留在顶部。请帮忙!
CSS:
HTML:
<div class="title-block">
<div class="img-holder"><img width="101" height="104" src="http://www.test.com/test.jpeg" /></div>
<div class="title">Get Your Nose Out of Your IPhone</div>
</div>
CSS:
.title-block {
width:272px;
height: 110px;
vertical-align:middle;
}
.img-holder {
float: left;
margin: 0 6px 0 0;
position: relative;
}
.img-holder img {
display: block;
}
.title {
display:block;
text-transform: uppercase;
margin: 8px 0 9px;
}