Jump to content

Valid?


Primal

Recommended Posts

This is my CSS code. It's not showing up with any errors on the W3C validator, but it's not saying it's correct either. Anyone know why?

body { background-color : #006000 ; color : #00EE00 }h1 { color : #00EE00 ; text-decoration : underline ; background-color : #006000 }hr { width : 65% ; color : #00CC00 ; background-color : #006000 }h1.center { margin-left : auto ; margin-right : auto ; text-align : center }

Thanks,Primal

Link to comment
Share on other sites

Well, I believe nothing is wrong. Your CSS is just perfect. No errors or warnings.

Link to comment
Share on other sites

Guest FirefoxRocks

Unless you forgot to post some more code, your code is valid with no errors or warnings.Here is a more optimized version to save space:

body{background-color:#006000;color:#0E0}h1{color:#0E0;text-decoration:underline;background-color:#006000}hr{width:65%;color:#0C0;background-color:#006000}h1.center{margin:0 auto;text-align:center}

Link to comment
Share on other sites

theres no semi-colon at the end of each line, it should be:

body{background-color:#006000;color:#0E0;}h1{color:#0E0;text-decoration:underline;background-color:#006000;}hr{width:65%;color:#0C0;background-color:#006000;}h1.center{margin:0 auto;text-align:center;}

but other than that, your css is pefect and should be valid.

Link to comment
Share on other sites

Actually, the last semi-colon per selector is optional. It's only a good habbit to add it, but for better file size, it's better to remove it.

Link to comment
Share on other sites

What are these 3 digit Hex Codes? I have never seen this before. And what is this {margin:0 auto;text-align:center} ? I was told to do it the way I have it in order to trick older browsers, is this not true?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...