例如上面的佈局,咱們可使用裏面元素浮動,外面的div高度爲0的特色來佈局,使2個div重疊在一塊兒css
<div class="pretext1-nexttext1"> <span class="pretext1" >無</span> <span class="nexttext1" >站點名稱2</span> </div> <div class="banner_jiantou"> <span class="pre" style="z-index:100;"><img src="../../dist/img/left-jiantou.png" width="29" /></span> <span class="next" style="z-index:100;"><img src="../../dist/img/right-jiantou.png" width="29" /></span> </div>
.banner_jiantou{width:450px;margin:0 auto;margin-top:2px;} .pre{float:left;} .next{float:right;} .pretext1-nexttext1{ width:900px; margin:0 auto;font-size:20px;} .pretext1{width:30%;float:left;text-align:right;padding-right:30px;} .nexttext1{width:30%;float:right;text-align:left;padding-left:30px;}