I have seen lot of blog posts/articles using the
align attribute for
p elements while surfing. This has prompted me to bring this up with you. We will see later that it is not the matter of using just the
align attribute but a lot of deprecated HTML elements and attributes.
In most of the blogging engines the document type is controlled by the templates part of the user interface. As most of us now know, all the webpages will eventually be migrated/upgraded to XHTML from HTML. The document type is typically set using one of the following declarations:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
These declarations mean that the document has to now comply with the restrictions of the specified document type to be qualified valid. This validity is significant not only for sytanx or semantic purpose, but the Search Engine Optimization (SEO) might be affected by it. The basic reason being that the search engine spiders or bots crawl through the HTML page and can perform better with valid web pages. Lorelle’s Improve Your SEO Standards With WordPress.com Blogs has a nice section on why Broken Code Breaks Search Engines.
Now, the XHTML Transitional declaration is something provided for enable transition from HTML 4.* to XHTML. XHTML Transitional allows certain deprecated HTML elements, which are rejected by XHTML Strict documents. Here is a nice document listing difference between the two. The final destination is to comply with XHTML Strict and not continue with the transitional version.
The templates, which define the document types can very well upgrade to XHTML Strict independent of the posts we write, but the webpage will invalidate if the posts that they display contain deprecated HTML elements. The validity of the webpage is not defined only by the template but also by our posts. I cannot imagine the effort to change every post to make it XHTML Strict compliant, whenever required in future, unless some tool does that for us. Is it wise to not use the HTML deprecated elements right now in the post so that it is easier to comply with stricter XHTML version later?
Copyright Abhijit Nadgouda.