-2
为什么如果根元素.wrapper
有overflow: hidden
和width:100px
,它仍然显示全部三个.item
元素?我想只显示一个(其中一个)并隐藏其他,但底层,.item
必须在同一行,所以我可以动画滑动。Css - 集溢出:隐藏在浮动元素的容器
SORRY,编辑的jsfiddle LINK:http://jsfiddle.net/QpdY9/
HTML
<div class="wrapper">
<div class="itemWrapper">
<div class="item a"></div>
<div class="item b"></div>
<div class="item c"> </div>
</div>
</div>
CSS
.wrapper {
width:100px;
height:100px;
overflow:hidden;
}
.item {
width:100px;
height:100px;
float: left;
}
.itemWrapper{
width:300px;
height:100px;
overflow:hidden;
}
.a {
background-color: red;
}
.b {
background-color: blue;
}
.c {
background-color: yellow;
}
它正如你所说... [看这里](http://jsfiddle.net/harsh_shah/v26Gz/)那么你想要什么帮助? –
@HarshShah:检查jsfiddle链接 – Krab
@Krab ..请检查我提供的小提琴链接 –