【发布时间】:2011-05-23 18:30:45
【问题描述】:
我有一个 DIV ...
<div id="content">
</div>
现在...在设计中,如果您认为它是一个矩形,顶部是页眉,页脚也不同,所以我不能只创建一个 1px 背景图像并重复它。
我必须这样做:
<div id="content">
<div id="header">This will have a fixed bg image</div>
<div id="body-content">This will have a repeated bg image and it's the part that can grow.</div>
<div id="footer-content">THis will content a fixed bg image for the footer</div>
</div>
谁能告诉我处理这种设计CSS的最佳方法吗?
【问题讨论】:
-
不要使用 1px 背景图片,而是使用 >=4px 背景图片以获得更好的浏览器性能。
-
页眉和页脚是否固定大小(高度)?
-
是的,固定大小的高度和宽度。唯一会扩大的是中间区域。