Computers 'n Stuff: Validate the source code of your blog so it displays correctly in more browsers

I here share the resolutions for my Linux problems so they might safe somebody some time.

Tuesday, November 29, 2005 parmanent link to this post

Validate the source code of your blog so it displays correctly in more browsers

Finally my blog inSUBordination is now XHTML1.0 Transitional compliant and approved by the W3C validator. If you like go and validate your blog too!

It's easy because you just have to enter your URL and the W3C validator will automatically load the source code of your blog. Don't paste your template directly because the blogger tags won't validate. Blogger tags have to be translated into HTML by the blogger engine first.

The most frequent errors I encountered where:


  • XHTML Tags and attributes have to be lowercase. Old code generators produced uppercase HTML Tags. e.g. <META CONTENT="foo"> (wrong) instead of <meta content="foo" /> (correct)

  • empty tags have to be closed using a slash (/), Empty tags do not enclose other elements, e.g. <br /> not <br>. Applies also to the <img> and <meta> tag.


  • Don't use the sign & because the browser thinks it follows a special sign which is delimited by a semicolon (;).

  • e.g. if you type: &copy; the browser will render it as the sign: ©
    If u need to use the & sign, enter the code &amp; instead.
    e.g. in URL use:
    ...foo.com&amp;action=foo... instead of ...foo.com&action=foo...

  • the <img> tag needs an mandatory alt="" element, a text describing the image that will be displayed if the image fails to load.

  • All values for elements within a tag need to be literal, i.e. they must be written between parentheses. This means use <img src="http://www.foo.com/foo.gif" border="0" /> instead of <img src=http://www.foo.com/foo.gif border=0 />.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home