The Difference Between XHTML Transitional and Strict

XHTML is one of many markup standards which coders, web designers, and more can choose from to complete their work. As with all computer languages, markups, and standards, XHTML comes from a long line of new versions, upgrades, and changes.

At their cores, the main difference between XHTML Transitional and Strict is that Transitional allows for criticized elements and attributes than Strict, and is therefore viewed as more merciful. All this change leaves developers in an interesting position where they have the power to simply choose their favorite markup, unless required to use one by an employer. While standards are suggested by overarching bodies like the W3, there is no police out monitoring what languages are used more readily.

The argument can be made, and rebutted, that XHTML Strict pushes for the separation of appearance and structure are better in the long run because these styles make websites more concise and easier to maintain.

Here are some examples of elements that ARE allowed in Transitional XHMTL but ARE NOT allowed in Strict XHTML:

  • center
  • font
  • iframe
  • strike
  • u

Similarly, there are a list of attributes that ARE allowed in Transitional XHTML but ARE NOT allowed in Strict XHTML including:

  • language
  • bgcolor
  • hspace
  • background

You can find comprehensive lists of all the attributes and elements which are not allowed when using XHTML Strict online.

There are also content model differences between Strict and Transitional which developers need to be aware of including blockquote, body, and form. With Strict XHTML, the content model differences place more restraints on the placement of text and images and more. Most developers who have made the switch from Transitional to Strict suggest moving all presentation features to CSS which will make the switch over easier.

While not everyone is completely on board with the idea that all developers should switch to XHTML Strict, it is still viewed by many as the language of the future of the web. Smart developers keep their skills relevant and therefore, learning XHTML Strict might be a good idea.

Leave a reply