gpt4 book ai didi

html - 如何垂直对齐这两个 div?

转载 作者:行者123 更新时间:2023-11-28 18:39:40 25 4
gpt4 key购买 nike

this jsFiddle , 如何垂直对齐图像和文本?

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;
}​

最佳答案

你可以像这样使用 float :

http://jsfiddle.net/xH2da/10/

您只需确保在需要时清除它们。

关于html - 如何垂直对齐这两个 div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11835732/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com