D4CH
05-25-2010, 10:40 AM
I made a website, and the background image of a DIV never showed up, so I got mad and deleted it all just to try again - with no luck.
As you can see here in this example, I have made a simple page with the following CSS:
body {
background-color: #000000;
}
#1th-logo {
height:69px;
width:165px;
background-image: url(../images/1th.png);
}
p {
color: #FFFFFF;
}
Really simple.
And this is the code in my HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="css/stylesheet.css" rel="stylesheet" type="text/css" media="screen"/>
</head>
<body>
<div id="1th-logo">
<p>asdasdasd</p>
<p>asd</p>
<p>asd</p>
<p>asd</p>
<p>asd</p>
<p>asd</p>
</div>
<img src="images/1th.png" width="165" height="69">
</body>
</html>
Also really simple.
And this is how it looks in dreamweaver:
http://imgur.com/jWJ8q.png
(I just filled in some random text to prove my point)
And now, this is the output:
http://www.thedaniel.dk/heidi/
As you can see, I've used an image tag and added the same image, but not in CSS. This works.
So, how the **** do I get that div to show the background image?
This is the simplest method I could do and yet it still isn't working.
As you can see here in this example, I have made a simple page with the following CSS:
body {
background-color: #000000;
}
#1th-logo {
height:69px;
width:165px;
background-image: url(../images/1th.png);
}
p {
color: #FFFFFF;
}
Really simple.
And this is the code in my HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="css/stylesheet.css" rel="stylesheet" type="text/css" media="screen"/>
</head>
<body>
<div id="1th-logo">
<p>asdasdasd</p>
<p>asd</p>
<p>asd</p>
<p>asd</p>
<p>asd</p>
<p>asd</p>
</div>
<img src="images/1th.png" width="165" height="69">
</body>
</html>
Also really simple.
And this is how it looks in dreamweaver:
http://imgur.com/jWJ8q.png
(I just filled in some random text to prove my point)
And now, this is the output:
http://www.thedaniel.dk/heidi/
As you can see, I've used an image tag and added the same image, but not in CSS. This works.
So, how the **** do I get that div to show the background image?
This is the simplest method I could do and yet it still isn't working.