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.


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

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

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

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

Speak Your Mind