div tag problem...please help asap -...

User 1947912 Photo


Registered User
114 posts

Hey.
Im trying to add a div tag to my page but it will not show. It is going to be a header eventually so ignore the sizes and colour. This is simply so i can see it first clearly before i start to size & colour it properly. I have added a bright backgound and dimensions that are 5 times bigger than my header will require but nothin still shows. Please help...

Index.html code =
<!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" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<style type="text/css">
body {
background-image:url('images/website_background.png');
background-repeat: repeat;
}
</style>
<link / rel="stylesheet" href="css/wrapper.css" type="text/css" media="screen">
<link / rel="stylesheet" href="css/header.css" type="text/css" media="screen">

</head>
<body>
<div id="wrapper">
<div id="header"></div>
</div>
</body>
</html>



header.css =
#header {
width: 400px;
height 100px;
color: #FF0000;
}



Iv used dreamweaver for 12 months and was creating beautifull looking sites but have taken the giant plungs into raw coding so please help and if you see anywhere else i may be going wrong id appreciate the help. Thank you.
www.andysmotorcycles.com
support@andysmotorcycles.com
(01782) 818097
Order motorcycle, scooter and motocross parts, spares and accessories online now.
User 463058 Photo


Ambassador
1,086 posts

Use "background-color".

"Color" is for coloring text.
User 117361 Photo


Ambassador
6,076 posts

sh00ta
My main suggestion would be that you organize all your css for ALL the web site into an external file. It will make it easier to find any glitches rather than have to dig into each individual page to find the snippet of code which might be affecting your styling.
You then just add a short little link into the head (not header) of each page which will refer back to that single css (style) file. Makes life much easier for you.
Sounds as if you are at the stage that a little reading would not go amiss to use as a reference.
User 1948478 Photo


Senior Advisor
1,850 posts

There is also a colon missing in "height 100px;"
(should be: height: 100px; )
User 364143 Photo


Guest
5,410 posts

Grrrrreat catch, Per. :)
CoffeeCup... Yeah, they are the best!
User 463058 Photo


Ambassador
1,086 posts

Tony the Tiger wrote:
Grrrrreat catch, Per. :)


What he said :)
User 1947912 Photo


Registered User
114 posts

Janys Hyde wrote:
sh00ta
My main suggestion would be that you organize all your css for ALL the web site into an external file. It will make it easier to find any glitches rather than have to dig into each individual page to find the snippet of code which might be affecting your styling.
You then just add a short little link into the head (not header) of each page which will refer back to that single css (style) file. Makes life much easier for you.
Sounds as if you are at the stage that a little reading would not go amiss to use as a reference.

Huh. As you can see from the seperate .css file i have provided I have always used seperate css, infact does anyone still use that method?, lol. I use 1 main css rule to cover the entire website and a couple of other for slight differences page to page. Thank you for trying though
www.andysmotorcycles.com
support@andysmotorcycles.com
(01782) 818097
Order motorcycle, scooter and motocross parts, spares and accessories online now.
User 1947912 Photo


Registered User
114 posts

Cary wrote:
Use "background-color".

"Color" is for coloring text.

Ah got it. Thank you.
www.andysmotorcycles.com
support@andysmotorcycles.com
(01782) 818097
Order motorcycle, scooter and motocross parts, spares and accessories online now.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.