开发者

How can I add multiple backgrounds to a single webpage?

How can I add multiple backgrounds to a single webpage? I 开发者_JAVA百科mean different backgrounds in different sections.


Just divide those sections by for example <div>.

<div id="section1"></div>
<div id="section2"></div>
<div id="section3"></div>

Then use the CSS background-image property on each of them.

#section1 { 
    background-image: url('images/section1.png');
}
#section2 { 
    background-image: url('images/section2.png');
}
#section3 { 
    background-image: url('images/section3.png');
}


Assuming you are using <div>s to section out your webpage, you can use the background CSS property to specify different backgrounds per section. Quick tutorial.


and if you don't care about explorer (oh, how nice that would be), you could use multiple background on one div (CSS3).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜