Tuesday, December 10, 2013

Common Html Errors and Warnings

Did you experience panicking after learning that your website did not meet the HTML 5 standards. Here are the list you should be probably look for to correct some obsolete or unnecessary codes or tags in your website or blog.


1. Attributes of the form xmlns:prefix must not be used in HTML (but can be used in XHTML).

Example:

<html class='v2' dir='ltr' xmlns='http://www.w3.org/1999/xhtml'xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>

<html class='v2' dir='ltr' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b'xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>

...class='v2' dir='ltr' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data'xmlns:expr='http://www.google.com/2005/gml/expr'>

2. Instead of the "name" attribute, use the "id" attribute. More: This "a" tag uses one or more entirely obsolete (in HTML5) attributes which must not be used in HTML5 documents. The HTML5 obsolete attributes for "a" include: "charset", "coords", "datafld", "datasrc", "methods", "name", "rev", "shape", and "urn". This message is displayed up to 5 times.

Example:

<a name='4571131736230013529'></a>

3. Instead of align="center", use the following CSS to center the table: "margin-left: auto; margin-right: auto". This is the correct CSS way but it may not work with some (mostly older) browsers. More: This "table" tag uses one or more entirely obsolete (in HTML5) attributes which must not be used in HTML5 documents. The HTML5 obsolete attributes for "table" include: "align", "background", "bgcolor", "cellpadding", "cellspacing", "dataformatas", "datapagesize", "datasrc", "frame", "rules", "summary", and "width". This message is displayed up to 5 times.

Example:

<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>


<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>


4.[64] '&' did not start a valid character reference in the value for "href" ("&target" is an invalid character reference). "&target;" is a recognized entity but the trailing semicolon appears to be missing. If this is not a character reference then encode the ampersand as "&amp;".

Example:

...></a><a class='goog-inline-block share-button sb-blog' href='http://www.blogger.com/share-post.g?blogID=7162135601108734039&postID=4571131736230013529&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-l...

5. The "g:plusone" tag specifies an undeclared namespace prefix "g"

Some website offer services to fix these issues regarding issue between new html 5 standards and previous blogger version . You may avail them at a price. However if you wish not buy any of their html coding and validation services, you may start to tweak the codes one by one. Another issue that many bloggers face is that they cannot entirely edit the html code to alter any errors audited by validation tools such as CSE HTML and  W3C HTML rendering your website or blog to be unstable. In fact, I am also encountering these kinds of issues and hopefully someone can help us solve this errors. 

No comments:

Post a Comment