xHTML vs HTML5


xHTML represents the best practices in coding of HTML. When one adds CSS to HTML and tags are not contained inside other tags – ambiguity begins to set in, when tags open in one parent and close outside of that parent, as to how content in certain areas should be rendered.  If a style is applied to a P or BR tag which does not have a specified ending tag does that property extend to the end of the page? Most browsers have decided it ends at the next BR or P tag.

xHTML 1 was necessary for proper rendering; or at least to know what proper rendering should look like.

xHTML 2 is a standard which forces the browser to give an error if the page is not in complete compliance to xml standards. Certain tags such as link are not part of that standard but they are used. Hence, many pages are written in a kind of xHTML that excepts HTML as well (which does not exist but we know what proper rendering should look like).

Technically speaking xHTML should have the document type from the server of application/xhtml+xml …

.htaccess

addtype application/xhtml+xml xhtml

… It is not being used. Here are the full requirements for xHTML http://www.w3.org/TR/xhtml2/conformance.html

HTML5 on the other hand support tags which are not documented as part of the “schema” but are supported by browsers.

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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: