在this jsFiddle中,如何垂直對齊圖像和文本?如何垂直對齊這2個div?
HTML:
<div class="step_div">
<div class="step_div_inner">
<div class="step_div_inner_image">
<img src="http://i.imgur.com/TasZn.png">
</div>
<div class="step_div_inner_text">
here is some text here is some text here is some text here is some text here is some text here is some text
</div>
</div>
</div>
CSS
.step_div_inner_text {
font-size:18px;
width:460px;
line-height:24px;
position:relative;
left:5px;
bottom:14px;
display:inline-block;
}
.step_div_inner_image {
display:inline-block;
}
.step_div {
padding:20px 0;
}
.step_div_inner {
width:574px;
margin:0 auto;
}
試圖把所有這些在一張桌子上。或者如果你只想把圖像或文字居中,把它們放在一個單獨的表格中。 – boyd 2012-08-06 20:53:50
圖像沒有出現在小提琴中。 – 2012-08-06 20:54:37
這裏有一些關於垂直對齊的提示:http://phrogz.net/css/vertical-align/index.html – 2012-08-06 20:55:14