Align Can Invalidate Your Post In Future

I have seen lot of blog posts/articles using the align attribute for div, img, 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"

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"

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 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?

Technorati tags: , , , ,

Copyright Abhijit Nadgouda.

6 Responses to “Align Can Invalidate Your Post In Future”

  1. Collin Says:

    Good evening!

    Just a quick note to say thanks for your comment on my blog, an apology for singling you out and hopefully a little further explanation now that I have calmed myself a little.


  2. Collin Says:

    On this subject of this very blog post, if “align” will invalidate the xhtml, do you think there will be a way to achieve the align on an img tag without actually using “align”?

    It’s something I find useful and allows the text to flow without having to resort to a table.

    Of course, I am not an expert at HTML and there may already be a way to do it….


  3. Abhijit Nadgouda Says:

    Hi Collin,

    There are ways of doing it by using pure CSS. CSS: centering things on is a good guide for this.

    My post here is more of a question than a suggestion. The fact is that some day XHTML Strict will become the norm and then deprecated HTML elements can pose problems.


  4. Collin Says:

    Indeed. What I currently use align for is to allow text to sit next to an image (usually a thumbnail in a blog as there’s so much wasted space that a full size image doesn’t fit…) rather than have a long line of thumbnails and then text.

    This page on my blog shows what I mean.

    I’ll go have a peek at the link now. Thanks!

  5. Collin Says:

    As far as the question goes, when HTML dies and XHTML Strict(er) is the standard, should we be considering what comes after that and not use any XHTML code that may be deprecated on the next version?

    We’d end up never coding anythin! As with anything (buying a new PC for example, I think we just need to jump in and do it. Certainly a nod to the future will help with future standards, but we can’t write EVERYTHING with the future in mind. Hey, if we did that then in 10 years time there’d be no need for legacy programmers as it’s already written…

  6. Abhijit Nadgouda Says:

    I agree that we cannot consider the future always, but we also cannot ignore certain facts that have been laid down. BTW, I would love if there are no legacy programmers 10 years later :-)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: