我有一系列浮动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内使用绝对定位。 –