gawain Posted July 6, 2006 Share Posted July 6, 2006 Hi.I tried to validate my css but I got back this answer:Parse error - Unrecognized : <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> body {text-align: center;}All the remaining CSS code is valid. But I don't understand where the mistake is and what is a parse error:unsure: The HTML Validification turned out to be OK.Thanks for any help Link to comment Share on other sites More sharing options...
Jack McKalling Posted July 6, 2006 Share Posted July 6, 2006 What exactly is the error? Link to comment Share on other sites More sharing options...
gawain Posted July 7, 2006 Author Share Posted July 7, 2006 What exactly is the error?<{POST_SNAPBACK}> That's the point which I don't understand. I quoted from the validator.I don't understand what a) a parse error is:) what "Unrecognized" refers toSorry about that. If anyone can help me.Thanks Link to comment Share on other sites More sharing options...
Jack McKalling Posted July 7, 2006 Share Posted July 7, 2006 So the parse error is only about the css part? body {text-align: center;}But there isn't any error in :)I cannot think of any error this piece of document would cause in, could you give me a link to the original document online?A parse error is a warning about something incorrect, from the validator. There are also "warnings", but parse errors specificially mean the validator cannot continue after that point, unlike with warnings. So a parse error is an error that disrupts the validator to continue. :)For example, if you had forgotten to put a comma somewhere, or a semi-colon, or put it somewhere where the validator haddn't expected it, then it would be a parse error. But if you forget to close a string somewhere, by qoutation marks, the validator thinks the string continues after you want it ended, and doesn't read it as a parse error. Link to comment Share on other sites More sharing options...
gawain Posted July 7, 2006 Author Share Posted July 7, 2006 Thanks. So the parse error is only about the css part?But there isn't any error in :)I cannot think of any error this piece of document would cause in, could you give me a link to the original document online?<{POST_SNAPBACK}> I'm afraid the document isn't online; I'm trying to build a centered navigation bar. Anyway this is all the code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head><title>centered menĂ¹</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">body {text-align: center;}#navlist {list-style-type: none; padding:0; margin: 0; }#navlist{width: 70%; background-color: #036;text-align: center;color: #fff;}#navlist li {display: inline;}#navlist li a {float: left; width: 5em; color: #fff; background-color:#049;padding: 0.2em 1em; /* TRouBLed rule*/text-decoration: none;border-right: 1px solid #039;}ul#navlist li a:hover {background-color: #369;color: #fff;}.c {text-align: center;}</style></head><body><div class="c"><ul id="navlist"><li><a href="#">Item one</a></li><li><a href="#">Item two</a></li><li><a href="#">Item three</a></li></ul></div></body></html>Thanks again. Link to comment Share on other sites More sharing options...
Jack McKalling Posted July 7, 2006 Share Posted July 7, 2006 Not that I have used EM before as a unit, but may I notice less than one EM would be the cause? I can't be sure, but that could be it. :)I found it rather difficult to think in EMs, I am used to pixels. Link to comment Share on other sites More sharing options...
jms Posted July 8, 2006 Share Posted July 8, 2006 I think you get this error because you're putting XHTML through the CSS validator. Try putting it though the XHTML one. You'll have to put your CSS into a seperate stylesheet to test it in the CSS validator. Link to comment Share on other sites More sharing options...
gawain Posted July 8, 2006 Author Share Posted July 8, 2006 Thanks for replying. The problem has been solved as soon as I resorted to an external CSS: it has been validated by the CSS validator. (So the solution with xthtml - to put it simply - is: don't use internal CSS)As to XTML validator it did validate the file all the same.So thanks again for helping me.I must say I still feel a bit frustated. I'd like to know more about the matter and all the question.I tried to read about doctype and stuff like that, but without the help pf the forum all my efforts were thwartedThanks again Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now