CSS溢出:隐藏;不起作用

时间:2010-04-07 01:09:04

标签: css overflow

我遇到溢出问题:隐藏在我的情况下不起作用。

我有一个div id = ticker,它基本上像滚动滚动条一样工作。所以我将动态内容添加到div id = ticker

div id = ticker包含在另一个div中,另一个div包含在另一个div中,基本上就像4-5级树一样想结构

身体 - > div [id = wrapper] - > div [class = main] - > div [class = content] - > div [class = frame] - > div [class = bg] - > div [class = primary-content] - > DIV [ID =股票]

继承人... ...

#wrapper {
 width: 942px;
 margin: 0 auto;
 position:relative;
 overflow:hidden;
}

.main{
 width:942px;
 margin:163px 0 0;
 overflow:hidden;
}

.content{
 background:url(../images/content-bg.gif) repeat-y;
 overflow:hidden;
 width:662px;
 float:left;
}

.frame{
 background:url(../images/frame-bg.gif) no-repeat 0 0;
 width:662px;
}

.bg{
 background:url(../images/bg-bg.gif) no-repeat 0 100%;
 width:662px;
 overflow:hidden;
}
.primary-content{
 padding: 12px 20px 40px 22px;
 width:620px;
 overflow:hidden;
}

#ticker {
    overflow: hidden;
}

此外,如果它有帮助 - 股票代码div包含div [class = breadcrumps]的列表,我试图滚动

.breadcrumbs{
 border-bottom:1px solid #ebebeb;
 padding:6px 0 6px 0;
 overflow:hidden;
 clear:both;
}

我所看到的是 - 当我将breadcrumps div添加到自动收报机时,页面/自动收录器列表会越来越大:(

任何帮助都将不胜感激。

感谢。

1 个答案:

答案 0 :(得分:20)

你需要定义宽度和高度才能使溢出工作,否则它只会扩展。