·实现一行三列

首先设置class

 1 <div id="content">
 2  <div class="col1">
 3  1
 4  </div>
 5  <div class="col2">
 6  2
 7  </div>
 8  <div class="col3">
 9  3
10  </div>
11   </div>

在使用css设置样式

 1 #content{
 2     clear:left;
 3     width:1200px;
 4     margin-top:80px;
 5 }
 6 #content .col1{
 7     float:left;
 8     min-width:380px;
 9 }
10 #content .col2{
11     float:left;
12     min-width:475px;
13     margin-left:22px;
14     margin-right:22px;
15 }
16 #content .col3{
17     float:left;
18     min-width:300px;
19 }

运行效果就是这样的:

这样就做好了

猜你喜欢

转载自www.cnblogs.com/q2546/p/11049938.html