CSS 100%高度+标题与静态高度; [英] CSS 100% height + header with static height;
问题描述
我正在建立一个包含标题,高度为40像素的布局。
I am building a layout which includes a header, which is 40 px in height. Underneath this header a SWF resides that should take up the rest of the available space.
最好的解决方案,直到现在已经使用一个表,给第一行40px的高度而第二行的高度为100%,但这些行仍然在Internet Explorer中添加,导致滚动条出现40个额外的像素 - 这不应该是这样。
The best solution untill now has been working with a table, giving the first row 40px height and the second row a 100% height - but these rows still add up in Internet Explorer, resulting in a scrollbar appearing for 40 extra pixels - which should not be the case.
我试过使用这个: http ://www.456bereastreet.com/archive/200609/css_frames_v2_fullheight/ - 如果您的内容最终会下推,但如果内容为100%的SWF,则会占据整个网页,或者一半页面(取决于将SWF放在内容div或SWF是内容div)。
I tried using this: http://www.456bereastreet.com/archive/200609/css_frames_v2_fullheight/ - it works fine if you have content that pushes down eventually but with a SWF with 100% in it, it will take over the whole page, or half the page (depending on putting the SWF in the content div or the SWF being the content div).
在使用javascript来处理此业务之前想知道别人是否知道更好的解决方案?
Before I resort to javascript to take care of this business I am wondering if someone else knows a better solution?
推荐答案
尝试将标题设置为静态。因此它漂浮在主体上,并将主体设置为100%高度。然后给身体一个40px填充在顶部。
Try setting your header as static. So it floats over the main body, and set the main body to 100% height. Then give the body a 40px padding on the top.
这篇关于CSS 100%高度+标题与静态高度;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!