| |
|
| W3C Compliancy
| 1. |
Don't Panic | Sometimes one error will generate many error messages, so it's not always as bad as it
looks. Also, the learning curve is encouraging – although the first documents you attempt to w3c-validate
may be full of errors, you'll catch on pretty quickly. |
| 2. |
Close tags | All paired tags like html, body, head, table must be closed. |
| 3. |
Self Closing Tags | All self-closing tags, such as br, hr, img,
must have a "/" before the closing ">". |
| 4. |
Use lowercase | All tag and attribute names must be in lowercase (except, apparently, "!DOCTYPE"). |
| 5. |
Quote attributes | All attributes must be in quotes (single or double). |
| 6. |
doctype |
The page must begin with a "doctype" tag. Here is what I use:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 7. |
html | Next, the "html" tag is required. |
| 8. |
head | Next, the "head" tag is required. |
| 9. |
charset | In the "head" section, a meta tag defining the character set is required. Here is what I typically use:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>.
If the page is php, then you can put in your php code:
header("Content-type: text/html; charset=utf-8"); |
| 10. |
title | Apparently, the "title" tag is required,
since when I omitted it, I got an error message – that the head not closed! When put in title, it was valid! |
| 11. |
script | type="text/javascript" is required for script. |
| 12. |
script | No script section may appear between the head and the body. Nor may it appear after the body
– which I think is going to cause a lot of problems for me...! |
| 13. |
style | type="text/css" is required for style. |
| 14. |
style | No style section may appear in the body – it must occur in the head section. |
| 15. |
body | The following attributes are not supported:
leftmargin, topmargin, rightmargin, bottommargin, marginwidth, marginheight.
To define the margins of your docment, use instead CSS: margin-left, margin-right, margin-top, margin-bottom. |
| 16. |
style | The "style" attribute may not appear twice for the same object. |
| 17. |
img | An img must have the "alt" attribute. |
| 18. |
textarea | A textarea must have the "rows" and "cols" attributes. |
| 19. |
Child without parent | A td or tr may not occur without defining a table;
an li may not occur without defining a ul or an ol; etc. |
| 20. |
Character symbols | In character symbols like , do not omit the ";". |
| 21. |
Character symbols | A misspelled symbol, as in &nbbsp;, will generate an error. |
| 22. |
& | If you want an actual "&" in your text, then use "&"; otherwise, you will get a warning.
If you have an & inside a URL, you get an actual error message! which seems silly to me. |
| 23. |
– | Do not use – for dash. Use – instead. |
| 24. |
< | A < anywhere, when not part of an actual tag definition,
yields a warning – even in javascript! So in html, always use < and put
the contents of all scripts inside <!-- -->. |
Check this page for W3C Compliancy
Top of Page
|
|