W3C HTML Validator Invalid

, ,
Want to master JavaScript in a month? Commit. Buy Xah JavaScript Tutorial. You also get Xah HTML Tutorial and Xah CSS Tutorial.

The W3C HTML Validator is getting annoying.

Missing Open Tag as Valid

If you have a page without a opening “body” tag, but does have a closing one, W3C HTML validation report it as valid.

Maybe it's technically valid, but quite annoying.

Test page: W3 HTML Validation Problem: No Open Body.

XHTML Style “<br />” Tag as Valid HTML4

If you use the XHTML style tag such as <br />, it's also reported as valid. W3C only gives a warning. However, this is technically invalid.

Test page: W3 HTML Validation Problem: Slash End Tag.

“p” Tag in “li” as Valid HTML4

If you have “p” tag inside “li”, it's valid! Even in HTML 4 strict.

(Note that technically any ending tag of “p” and “li” can be omitted.)

Test page: W3C HTML Validation Problem: p in li.

ID Value Can Start with a Unicode Symbol!

Loly, by W3C spec at http://www.w3.org/TR/html401/types.html#type-name, the value for element attribute (⁖ {id, class}) must start with a letter. Quote:

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

However, you can start with a Unicode greek α and it passes W3C's validator.

<p id="ααα">This paragraph has id “ααα”.</p>

Here's a test page: Test: Unicode Character in HTML ID Attribute Value.

blog comments powered by Disqus