Hello, world!

XHTML HTML

XHTML is nearly the same to HTML 4.01 with a bit distinction that will be discussed on HTML Tutorial. When you are already familiar with HTML, it's time for you to study this recent HTML version.



Defining XHTML

Majority of what you learned about HTML is still related in XHTML (Extensible HyperText Markup Language). It is almost the same as HTML but XHTML is more consistent. It is HTML identified as XML application and can be applied in any major browsers.

Converting HTML to XHTML

1. XHTML <!DOCTYPE> Is required to add at the first line of every page

Example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Title of the Page</title>
</head>
<body>
  some text
</body>
</html>

2. The xmlns element must be added to the html element of each page.

Example:
<html xmlns="http://www.w3.org/1999/xhtml">

3. All elements must be change in lower case.

Wrong:
<BODY>
<P>Put some text
  here</P>
</BODY>

Correct:
<body>
<p>Put some text
  here</p>
</body>

4. Empty Elements require a closing tag

Wrong:
A break: <br>
A horizontal rule:
  <hr>
An image: <img
  src="image.gif" alt="image">

Correct:
A break: <br />
A horizontal rule:
  <hr />
An image: < img
  src="image.gif" alt="image " />

5. All attribute names must be change in lower case.

Wrong:
<table HEIGHT="50%">

Correct:
<table  height="50%">

6. All attribute values must be quoted

Wrong:
<table height =50%>

Correct:
<table  height="50%">