我正在开发一个两列响应布局。一列有图像,另一列有文字。我想对齐图像vertical:middle;
,我尝试了几个技巧和stackoverflow的答案,直到我能够实现它。这里是我的代码如下如何将图像垂直对齐到浮动文本
HTML
<div class="row">
<div class="col">
<img src="http://placekitten.com/g/200/300">
</div>
<div class="col">
<h2>Quicker answers to your customer’s questions.</h2>
<p>Potential customers visit your site to learn more about what you do and how it can help them. When they have a question, our web chat tool gives them a direct line to your customer support and expert knowled</p>
</div>
</div>
风格
h2{
margin:0;
}
.col{
float:left;
width: 50%;
vertical-align: middle;
}
任何一个可以帮助解决这个问题。提前致谢。
+1用于在那里放置一只小猫。 – 2014-09-11 13:18:48