mwbarker
01-09-2010, 09:56 AM
I am trying to display a top and bottom background image within css. This is my css (basic for a test):
/* basics */
* {margin:0;padding:0;}
/* structure */
body{
margin: 0 auto;
padding: 0px;
text-align:center;
background: #5d4c3a url(img/urbandarker.jpg) no-repeat top center;
}
#bg{
background:url(img/urbandark_btm.jpg) repeat-y bottom center;
}
This the the html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</head>
<html>
<body>
<div id="bg">
<p>Why is the background at the top when it is listed as "background:url(img/urbandark_btm.jpg) repeat-y bottom center;"</p>
</div>
</body>
</html>
Why is the div "bg" background showing above the body background?
You can see the demo here:
http://dev.upliftingdesign.com/test/
/* basics */
* {margin:0;padding:0;}
/* structure */
body{
margin: 0 auto;
padding: 0px;
text-align:center;
background: #5d4c3a url(img/urbandarker.jpg) no-repeat top center;
}
#bg{
background:url(img/urbandark_btm.jpg) repeat-y bottom center;
}
This the the html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
</head>
<html>
<body>
<div id="bg">
<p>Why is the background at the top when it is listed as "background:url(img/urbandark_btm.jpg) repeat-y bottom center;"</p>
</div>
</body>
</html>
Why is the div "bg" background showing above the body background?
You can see the demo here:
http://dev.upliftingdesign.com/test/