我想在整个 HTML 文档中都有渐变,并且在 BODY 标签的中心,我需要另一个背景居中。
编辑看看它失败了多少试试:
http://xn--wiadomesny-37b.pl/bg
这张图片解释了它:
如果我输入 CSS,它会失败,即使下面应该显示重复-y 背景,也只会显示 1 个背景:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
html {
background-color: #ffeacd;
background-image: url(bg.png);
background-repeat: repeat-x;
}
body {
background-image: url(bg_overlay.png);
background-repeat: no-repeat;
background-position: center;
}
.content {
width:1020px;
padding: 0px;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
}
</style>
</head>
<body>
<div class="content">
<p>This content is closed in 1020px wide DIV, as to merge in most displays. </p>
<p>Rest around is an background seen or unseen depends on users screen size. </p>
<p>Me got 24'' so its obvious that I will see all backgrounds and even gradients as
blank space fillers</p>
<p>
<h1>See how much it fails in various browsers:</h1>
<ul>
<li><a href="chrome.png">Chrome</a></li>
<li><a href="ff.png">Firefox</a></li>
<li><a href="ie.png">IE</a></li>
</ul>
</p>
)</div>
</body>
</html>