1) in your style.css file change your div's from .mainbody to #mainbody and .mainnav to #mainnav
2) in your website directory, where is the style.css in relation to this page that you have made? If it's in the same directory, then in the html page change
href="/style.css" to href="style.css"
3) you've missed one terminating ";" symbol in the css on the "top: 2em" line. And, as a good practice, you should also terminate the "width: 9em" line with a ";"
Here's what I rewrote and tested on my system. I added a default body style, just my preference.
=========
style.css - located in same directory as test.html
=========
body{
margin:0;
padding:0;
background-color: #ccc;
}
Now this is how the html/css tag is setup. it's no big deal, but you can download HTMLkit. That html editor will help you with your tags.
An external style sheet may be linked to an HTML document through HTML's LINK element:
The tag is placed in the document HEAD. The optional TYPE attribute is used to specify a media type--text/css for a Cascading Style Sheet--allowing browsers to ignore style sheet types that they do not support. Configuring the server to send text/css as the Content-type for CSS files is also a good idea.
2007-12-08 11:48:06
·
answer #5
·
answered by Johnny S2
·
0⤊3⤋