Main reasons for Invalid XHTML pages in blogs

Watching your blog pass all the validations like html, xhtml, css etc. is actually satisfying for everybody. W3Schools validator tool is the most popular one used for the purpose. Many Blogger users should have found that however hard they try there will still be errors if the strict check is enabled, Why?

1. For Blogspot : If you know your page well and look at the errors shown you will come to the sad conclusion that you will NEVER be able to make your page valid..It’s because even if write your posts and template in valid xhtml the Blogger parts – Navbar, iFrames and attributes used with them are not properly xhtml formatted. You can do nothing about them.

There are some common errors among these especially if you come from an HTML background. Many of the attributes used in HTML are invalid if we use xhtml strict mode.

2. For all : If you are a blogger or a web page developer there can be errors in your document. Of course if you are only starting you may not be able to resolve many of this. So following are the main errors and the suggestions to rectify them.

General

Always use small letter for all tags and attributes. ie use <img src=” ” alt=” ” /> instead of <IMG arc=” ” ALT=” ” />

<META>

Use small letters as well as close the tags your meta tags should read
<meta name=”name” content=”content” />

<a href=”"></a>

Always use title attribute for <a tag <a href=”http://sample.com” title=”my title”>Link Text</a>

<img>

Empty tags are not allowed in XHTML. so you need to use <br /> for <br>, <hr /> for <hr>, <img /> for <img>

width=..,height=..,

It is always better to use <style=”width:xx px; …”> The usage is as follows
<img src=”PATH” width=”xx” border=”mm”>>. for this try using <img src=”PATH” style=”border: toppx rightpx bottompx leftpx; margin: toppx rightpx bottompx leftpx; width:xxpx;” alt=”Alternate text” /> (you can use negetive numbers for margin border etc.. and also px can be changed to cm centimeter, in inch etc..)

alt=”TEXT”

Never forget to put alternate text, the text shown in image disabled browsers. (always use some text that best describes you image)

<sctipt language=”JavaScript”>

Use <script type=”text/javascript(VBscript)“>

<style>

be sure you use <style type=”text/css”>

<u>

This tag for underlining can’t be used (it works still) use <font style=”text-decoration:underline;”>

Most common errors – from W3Schools site

not using </li> or other closing tags, usage of empty tags like <br>, not using alt in images etc…

So check your web page for errors and go care fully through the result page so that next time you edit your page the error wont repeat.

Some related articles you may like :

  1. Save web pages as PDF and save to your desktop for free
  2. Save web pages as mht file for better management of documents
  3. Unexpected error on your webpage home – function.main failed to open stream
  4. Adsense temporarily down
  5. How to use affiliate links without loosing your PR?
  6. WordPress 2.5.1 update released
  7. Blogger template tags to customize your layout and design
  8. WordPress (Version 2.3.2) is out upgrade now

This entry was posted in Uncategorized and tagged Error, Tutorial, Web. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>