我有一个固定位置的标题(动态高度)。在html中的位置固定标题
我需要将容器div放在标题下方。由于标题高度是动态的,因此我无法使用顶部边距的固定值。
这怎么办?
这里是我的CSS:
#header-wrap {
position: fixed;
height: auto;
width: 100%;
z-index: 100
}
#container{
/*Need to write css to start this div below the fixed header without mentioning top margin/paading*/
}
...和HTML:
2012-06-11
Sowmya
+5
固定报头不是布局的一部分。它是浮动的。你需要给内容一个'margin-top',这样它的行为就好像标题在那里一样。 –
+3
阅读本文http://css-tricks.com/absolute-relative-fixed-positioining-how-do-they-differ/ –
+0
[CSS-Only Scrollable Table with fixed headers]可能出现重复(http:// stackoverflow。 com/questions/11891065/css-only-scrollable-table-with-fixed-headers) –