[CSS]—div+css怎樣放兩張連續的圖片在同一行?

來源:互聯網
上載者:User

<style type="text/css">
<!--
body {
font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; line-height: 20px; color: #000000;
}
#head{
margin-right:auto; margin-left:auto; width:770px; height:80px; background:#A66300;
}
.nav{
clear:both; margin-right:auto; margin-left:auto; width:770px; height:25px; line-height:25px; background:#415800;
}
#main_box{
/*本文區大容器*/
width:770px; margin-right:auto; margin-left:auto; background:#EFEFEF;
}
.row{
/*定義每行*/
width:100%; clear:both;
}
.left,.right{ float:left; width:150px; background:#A6A6A6;
}
.right{ float:right;}
.left2{
/*用在四列布局上*/
float:left; width:235px; background:#333; color:#FFF;
}
.left3{
/*用在五列布局上*/
border-right:1px solid #FFF; width:153px; background:#888; float:left;
}
.middle{
width:470px; background:#6699CC; float:left;
}
#foot{
margin-right:auto; margin-left:auto; width:770px; background:#A66300; clear:both;
}
-->
</style>
</head>

<body>
<div id="head"></div>
<div class="nav"></div>
<!--內容區開始-->
<div id="main_box">
<!--三列左側-->
<div class="row">
<div class="left"><p></p></div>
<div class="middle"><p></p></div>
<div class="right"><p></p></div>
</div>
<!--三列結束-->
<div class="nav">nav</div>
<!--四列開始-->
<div class="row">
<div class="left2"> <p>四列的第一列</p> <p> </p></div>
<div class="left"><p>四列的第二列</p><p> </p></div>
<div class="left2"> <p>四列的第三列</p> <p> </p></div>
<div class="right"> <p>四列的第四列</p> <p> </p></div>
</div>
<!--四列結束-->
<div class="nav">nav</div>
<!--五列開始-->
<div class="row">
<div class="left3"> <p>這是五列的第一列</p> <p> </p> <p> </p></div>
<div class="left3"> <p>這是五列的第二列</p> <p> </p> <p> </p></div>
<div class="left3"> <p>這是五列的第三列</p> <p> </p> <p> </p></div>
<div class="left3"> <p>這是五列的第四列</p> <p> </p> <p> </p></div>
<div class="left3"> <p>這是五列的第五列</p> <p> </p> <p> </p></div>
</div>
</div>
<!--尾部區-->
<div id="foot">
</div>
<!--End-->
</body>

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.