How to Convert HTML to XHTML – The 3 DOC TYPES

Since beginning my web design business I have always used HTML because I was always designing sites using tables. Since changing my table-based designs to css-based designs I have had to use XHTML. It was easier than I thought and now I find myself writing cleaner code, and marking up web pages faster then before.

Definition of XHTML 1.0

Extensible HyperText Markup Language (XHTML) is a reformulation of HTML 4.0 to make it XML based.

Types of XHTML (DOC TYPES)

The DOC TYPE is placed at the beginning of your web page. Here are the 3 doc types and their uses explained.

1. Strict – Use this for really clean structural mark-up. This is best used if you are using Cascading Style Sheets for presentation. Use it together with W3C’s Cascading Style Sheet language (CSS) to get the font, color, and layout effects you want.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

2. Transitional (most popular) – This is best used when creating web pages for the general public. It provides the benefits of viewing your pages with older browsers which can’t understand style sheets. These include using the body element with bgcolor, text and link attributes.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

3. Frameset – Use this when you want to use Frames to partition the browser window into two or more frames.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

” How to Convert HTML to XHTML ” – read other postings

Speak Your Mind

*