我正在開發一個兩列響應佈局。一列有圖像,另一列有文字。我想對齊圖像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