Yoast
05-16-2005, 11:29 AM
Hi,
I am trying to add a background image to a div.
Internet Explorer does display the background correctly, but Firefox aligns the background not to the div, but to the browser screen. Does anyone know what I am doing wrong?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>
<head>
<link title="stylesheet" href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="content"></div>
</body>
</html>
And here is the relevant CSS code:
.content {
position: absolute;
top: 20px;
left: 20px;
background-image: url(images/zonnebloeml.jpg);
background-attachment: fixed;
background-position: bottom left;
background-repeat: no-repeat;
width:515px;
height:500px;
border: 1px solid black;
overflow: auto;
}
I hope someone here knows how to fix it!
TIA
I am trying to add a background image to a div.
Internet Explorer does display the background correctly, but Firefox aligns the background not to the div, but to the browser screen. Does anyone know what I am doing wrong?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html>
<head>
<link title="stylesheet" href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="content"></div>
</body>
</html>
And here is the relevant CSS code:
.content {
position: absolute;
top: 20px;
left: 20px;
background-image: url(images/zonnebloeml.jpg);
background-attachment: fixed;
background-position: bottom left;
background-repeat: no-repeat;
width:515px;
height:500px;
border: 1px solid black;
overflow: auto;
}
I hope someone here knows how to fix it!
TIA