我有一个 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?
最佳答案
#header
{
background-image: url('header.png');
background-repeat: no-repeat;
}
#body
{
background-image: url('body.png');
background-repeat: repeat-y;
}
#footer
{
background-image: url('footer.png');
background-repeat: no-repeat;
}
关于html - 将背景图像添加到 div(动态内容),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6094952/