CSS validation question.

liunx

Guest
I just validated my HTML and went to validate my css but got this response in return:


To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use valid HTML.


Errors


URI : <!-- m --><a class="postlink" href="file://localhost/mysite3.html">file://localhost/mysite3.html</a><!-- m -->

Line: 14

Parse error - Unrecognized : <!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">
<head>
<title>My Cool Website</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<style type="text/css">
body {
margin: 0; padding: 0;
}


What is wrong with my css? How is the doctype unrecognized if my HTML validated correctly? What is wrong with my document parse tree? Thanks a lot for the help.Can you post a link to your page?My page is not on the web yet I am still working on it. Sorry. Do you need to look at something in particular to decipher what could be the problem? Maybe I can help with that. Thanks a lot.I think that's your problem. I think your page has to actually be on a server (not just your localhost) for the validator to check it.You can go here <!-- m --><a class="postlink" href="http://www.htmlhelp.org/tools/csscheck/">http://www.htmlhelp.org/tools/csscheck/</a><!-- m --> and copy/paste your stylesheet into the box for validating.I don't think so, at least not with the w3c validator. I think you can upload a local file.I've just tried it to be sure. Try it yourself.The w3c CSS validator page is a bit confusing (I did the same thing first time): it allows you to send a link to your page, wherein it finds and parses your CSS; but if you upload a file, it must be a CSS file only (such as what you might link to in your HTML head section). However, you can cut and paste your page's style section (without the <style> tags) into the third portion of their form to validate your CSS that way.In my haste, I left the <style> tags in and it didn't complain. :)In my haste, I left the <style> tags in and it didn't complain. :)
Great. Guess it was an assumption on my part. :)I just put css from another page I put together, not online just local, directly into the validate by input box on w3.org and this is what I got back.


To work as intended, your CSS style sheet needs a correct document parse tree. This means you should use valid HTML.

Errors

URI : <!-- m --><a class="postlink" href="file://localhost/TextArea">file://localhost/TextArea</a><!-- m -->

Line: 5
Parse error - Unrecognized : <style type="text/css"> body { background-color:#003366;



What is a parse tree and what is wrong with my parse tree? Does anything look wrong with the start of my css? Here is all the css:




<style type="text/css">

body {
background-color:#003366;
}

#content {
background-color:white;
margin: 1.5em 7.75em;
padding: 1em 1.80em;
text-align: justify;
border:#999999 ridge;
}

h1 {
text-align: center;
text-shadow: 0 0 0.2em #3366cc;
font-family: chicago;
}

#navcontainer ul {
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
}

#navcontainer ul li {
display: inline;
font-size: .80em;
}

#navcontainer ul li a {
text-decoration: none;
padding: .2em 1em;
color: #ffffff;
background-color:#003366;
}

#navcontainer ul li a:hover {
color: #ffffff;
background-color: #3366cc;
}

#description {
font-family: helvetica;
padding-top: 1em;
}

#description h3 {
color:#3366cc;
}

.italics {
font-style: italic;
border-bottom: solid #003366 1px;
padding-bottom: 1em;
}

#jordan {
border-bottom: solid #003366 1px;
}

#address ul {
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
color:#ffffff;
}

#address ul li {
display: inline;
}

#address ul li a {
color:#ffcc33;
}

#address ul li a:hover {
background-color:#3366cc;
padding: .25em;
}

</style>

Thanks a lot.
 
Top