2012-01-20 265 views
2

我有一堆DIV。在这些div中是可扩展的jquery面板,放置在这些div中。当面板扩展时,如果它大于div,它就包含在我希望扩展的范围内。我一直在尝试无尽的建议,但是我的CSS有些问题。感谢您的任何帮助。我想知道这是否是我的立场:绝对的。我需要顶部和左侧的属性被锁定,但divs可以向下扩展,我只是希望他们也将自己的属性推下。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; 


} 
+1

你可以粘贴一个div和css的例子在这里和点击运行? http://jsfiddle.net/ – Niklas

+0

不相关,但#headercontent有两个位置属性。我会说这是与绝对定位有关,或者事实上,网页上的所有内容似乎都有一定的宽度和高度,这意味着它不会扩展 – Alex

+0

如上所述,将您的html,css和jQuery放入http ://jsfiddle.net/也许我们可以看到更好的是什么问题。 – Deadlykipper

回答

1

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

请提供你的HTML文件的更多细节,我可以帮助你更多。

1

当你只展示一段css时,很难说出你的html做了什么。

但是从你展示的东西看来,它在我看来就像一个定位问题。把绝对的位置放在你的css之后,看看会发生什么。