How to understand XHTML formatting

How to understand XHTML formatting

XHTML is a standard way to format HTML pages. It ensures that HTML pages are not only legal in that they will generate content, but are written in a more uniform way. There are few requirements to writing XHTML pages, but they may be verified so that they indeed conform to the standard. XHTML stands for Extensible Hypertext Markup Language, and can be seen as HTML that fits XML requirements.

Tags: Internet Explorer Linux


An HTML editor, which may be a text editor.


At the top of your XHTML document, you must include the “DOCTYPE” and XML namespace attributes, such as:

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

Next, the <html>, <head>, <title>, and <body> HTML tags must be included in the page.

Nesting order of elements may not be rearranged. Each HTML element/tag must also have a closing tag.

HTML tags must also be lowercase, such as:


There can only be one root <html> tag.

Attributes within HTML tags must also be lowercase and quoted such as:

<div class="classname">

Attributes must also be fully formatted like the above <div> element, they cannot be minimized such as:

<option selected>