我有一系列浮動div,我想在水平線上旋轉到無窮大(繼續浮動)。這些div需要在有限寬度div內繼續。最終,我想按左右的div /按鈕滾動項目(與使用滾動條)。Floating Div - 停止清除/包裝
我無法讓div保持在其浮動狀態。一旦他們在父div內空間用完,他們開始包裝。
有什麼辦法可以繞過包裝嗎?一旦我弄清楚了,下一步就是使用jQuery來獲取水平向左/向右移動,以便它重複水平滾動。
這裏是小提琴我所做的和代碼:
HTML:
<div id='container'>
<div id='arrowL'>
</div>
<div id='arrowR'>
</div>
<div class='list'>
<div class='item'>
</div>
<div class='item'>
</div>
<div class='item'>
</div>
<div class='item'>
</div>
</div>
CSS:
#container{
width:340px;
height:50px;
}
.list{
background:grey;
width:300px;
height:50px;
float:left;
}
#arrowR{
background:yellow;
width:20px;
height:50px;
float:right;
}
#arrowL{
background:yellow;
width:20px;
height:50px;
float:left;
}
.item{
background:green;
width:140px;
height:40px;
margin:5px;
float:left;
}
任何和讚賞所有幫助。謝謝!
其實我不理解你的問題在這裏,究竟你所要求的 –
不能使用float這樣的事情。在相對定位的外部div內使用絕對定位。 –