CSS扩展DIV并推动其他人

时间:2012-01-20 13:37:01

标签: css html

我有一堆DIV。在那些div中是可扩展的jquery面板,放在那些div中。当Panel扩展时,如果它大于它所包含的div,我希望它扩展。我一直在尝试无穷无尽的建议,但我的CSS有问题。感谢您的任何帮助。我想知道这是不是我的立场:绝对。我需要锁定顶部和左侧属性,但div可以向下扩展,我只是希望它们能够将它们自己推下来。

#framecontent{
        position: absolute;
        top: 0;
        bottom: 0; 
        left: 0;
        width: 815px; /*Width of frame div*/
        height: 600px;
        overflow: auto; /*Disable scrollbars. Set to "scroll" to enable*/
        overflow-x: hidden;
        background-image: url('../images/Bkgrnd.png');
        background-repeat:repeat-x; 
}


#listcontainer{
        position:absolute;
        width: 260px;
        margin-top: 70px;
        margin-left:40px;
}

/* Main Header */
#headercontent{
        position:absolute;
        background: #3e3e3e;
        top:0px;
        height: 65px;
        width: 615px;
        position: fixed;
        left: 200px;
}

#subheading1 {      
        position: absolute;
        background: #585858;
        top: 65px;
        height: 45px;
        width: 615px;
        left: 200px;
        color:#ffffff;
}

#response{
        position: absolute;
        background: #585858;
        top: 110px;
        min-height: 115px;
        width: 615px;
        left: 200px;
        color:#ffffff;
        /* box-shadow:inset 5px 5px 2px  #000000;  */
}

#subheading2 {      
        position: absolute;
        background: #313131;
        top: 225px;
        height: 45px;
        width: 615px;
        left: 200px;
        color:#ffffff;
}

#summary {
        position: absolute;
        background:  #454545;
        top: 270px;
        height: 375px;
        width: 615px;
        left: 200px;


}

2 个答案:

答案 0 :(得分:1)

当你只展示一块css时,很难说你的html会做什么。

但是从你展示的内容来看,它就像一个定位问题。从你的CSS中取出绝对位置,然后看看会发生什么。

答案 1 :(得分:1)

从CSS中删除所有位置:绝对值。然后,如果你想与其他人对齐,你可以使用margin,padding和float ......

请提供HTML文件的更多详细信息,我可以为您提供更多帮助。