对齐多个div css

时间:2016-06-18 18:39:26

标签: html css

我想知道如何在一组位置中对齐多个div我喜欢container1在左边,容器在中间,容器3在右边全部相互连接。最后我希望container2位于中心底部的容器下方。如果你不明白请帮忙请问

<div class="container1" style="border-width:1px; float: left; border-style:solid; width:350px; height:500px;  z-index:1; visibility:; background-color: lightgrey;visibility:;">


  container1

</div>

<center>
  <div class="container" style="background-color:lightgrey; border-width:1px; border-style:solid; width:500px; height:500px;  z-index:1; visibility:; float: center; visibility:; background-color: lightgrey;visibility:;">

    container
  </div>
</center>

<div class="container3" style="border-width:1px; float: right; border-style:solid; width:350px; height:500px;  z-index:1; visibility:; background-color: lightgrey;visibility:;">

  container3
</div>
<div class="container2" style="border-width:1px; float: bott; border-style:solid; width:500px; height:100px;  z-index:1; visibility:; background-color: lightgrey;visibility:;">

  container 2
</div>
​

1 个答案:

答案 0 :(得分:0)

为.container1,.container&amp;写css。 .container3为“float: left”。 .container2不应该有任何类型的浮动