...

View Full Version : Resolved DIV background image does not show



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.

abduraooft
05-25-2010, 10:54 AM
The CSS validator will give you the reason, see http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.thedaniel.dk%2Fheidi%2F&profile=css21&usermedium=all&warning=1&lang=en

You can't have the value of an id attribute starting with a number.

D4CH
05-25-2010, 11:00 AM
The CSS validator will give you the reason, see http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.thedaniel.dk%2Fheidi%2F&profile=css21&usermedium=all&warning=1&lang=en

You can't have the value of an id attribute starting with a number.

Well I'll be damned ...

Thanks a million!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum