2010-05-14 86 views
0

我想要做的就是滑动第一个div的内容,以便显示的唯一内容是不被外部div隐藏的内容。如何将灵活的宽度div放入固定宽度的容器中?

我想这一点,但不工作

#contenedorProductos { 
margin-left: 50px; 
float: center; 
position: absolute; 
width: 490px; 
text-align: center; 
z-index:1; 
} 

#contenedorProductos #contenidoProductos { 
overflow: auto; 
position: absolute; 
width: auto; 
} 

我的英语水平,不要让我更好地解释,希望这可以理解...谢谢你。

回答

1

需要设置overflow: hidden;在外层div,和从内DIV除去position: absolute;(从外层div和可能 - 余量和浮子具有使用绝对位置时没有作用):

#contenedorProductos { 

    margin-left: 50px; 
    float: center; 
    width: 490px; 
    text-align: center; 
    z-index:1; 
    overflow: hidden; 

} 

#contenedorProductos #contenidoProductos { 

    width: auto; 

}