I've been banging my head all day with this (probably very simple) problem, and it's driving me mad. Wondering if please you could help me....
The HTML and CSS has lots more in but I've stripped out all the unneeded code to just get to the problem.
So the CSS (css folder and called style2.css) is...
body {
background-color: #3b3b39;
}
#container {
width: 1000px;
margin-right: auto;
margin-left: auto;
}
#page {
background-image: url('../images/background.jpg');
background-repeat: no-repeat;
background-position: center top;
height: auto;
}
The HTML is...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" href="css/style2.css" type="text/css" media="screen" />
</head>
<body>
<div id="container">
<div id="page">
</div>
</div>
</body>
</html>
With the above the background.jpg doesn't show at all. Not in any browser.
I read something about empty DIVs not displaying background images, so I tried...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link rel="stylesheet" href="css/style2.css" type="text/css" media="screen" />
</head>
<body>
<div id="container">
<div id="page">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
</div>
</div>
</body>
</html>
And the background image was shown, but only the part of the image that was under the <br />'s, however I can't have those <br />'s there so I must be missing something but I've no idea what.
The next part of the code (that I've removed from the about code) is...
<div class="clear" id="content">
<h1>Heading blah, blah</h1>
</div>
With the CSS...
#content {
width: 800px;
margin-left: 100px;
float: left;
padding: 10px;
}
and also...
.clear {
clear: both;
}
I've put this content DIV part here because when I include it in the page, the page goes haywire again, not showing the background at all.
I'm very confused, so any advice greatly appreciated.