如果你想多背景圖片,但不希望他們重疊,你可以使用這個CSS:
body {
font-size: 13px;
font-family:Century Gothic, Helvetica, sans-serif;
color: #333;
text-align: center;
margin:0px;
padding: 25px;
}
#topshadow {
height: 62px
width:1030px;
margin: -62px
background-image: url(images/top-shadow.png);
}
#pageborders {
width:1030px;
min-height:100%;
margin:auto;
background:url(images/mid-shadow.png);
}
#bottomshadow {
margin:0px;
height:66px;
width:1030px;
background:url(images/bottom-shadow.png);
}
#page {
text-align: left;
margin:62px, 0px, 20px;
background-color: white;
margin:auto;
padding:0px;
width:1000px;
}
這個HTML結構:
<body
<?php body_class(); ?>>
<div id="topshadow">
</div>
<div id="pageborders">
<div id="page">
</div>
</div>
</body>
最新版本的Firefox,Chrome,Safari和Opera支持多種背景。它也將在IE9中得到支持。 http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(Cascading_Style_Sheets) – 2010-10-30 23:44:56
如果你想有不同的重複/位置設置,你可以這樣做:http://www.css3.info/preview/multiple-backgrounds/ – Krisc 2011-03-05 19:56:32