我在主 div 元素中有两个 div 元素,我希望这两个 div 向左浮动并对齐主 div 的中心。像这样的东西。
[ main div [div1][div2] ]
我已经成功地浮动了两个 div,但我未能在两侧分配空间。我的意思是说将它们居中对齐。代码浮动左CSS
.container{
width:100%
height: auto;
}
.img{
width:auto;
height:auto;
float:left;
}
.data{
width:auto;
height:auto;
}
html code
<div class="container">
<div class="img"> image goes here</div>
<div class="data">data goes here</div>
</div>
摇曳的蔷薇
神不在的星期二
相关分类