Jump to content

DOCTYPE and PARSE ERROR


gawain

Recommended Posts

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

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

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?

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

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

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

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...