Valid XHTML 1.0!

Valid CSS!

©2004 -pch-

How to use XHTML

What is XHTML? This is the language for Web formatting. It means eXtensible HyperText Markup Language. The source is in HTML, but this one is more correct.
XHTML uses "tags" - special symbols for text writing. The tags are filled in brackets < >.
The role of HTML is a little behind its extent. It has been finished in the HTML 4.01 version. But this one isn´t out of date. The most pages are written in this code and the validator for controlling exists.

Simple XHTML structure

1. Document structure

This document is formed by: XML declaration, information for browsers and the content.

2. XML declaration

The XML version, the information about code using and the specification !DOCTYPE with information about applied language.

3. Document body

The part of the document is filled in the element html. This element consists of two sections:

Metainformation

This information is in the head of the document and it´s filled in the element head.

Document content

The content is filled in the element body. This section forms the document structure. We can say that these statements are appeared in two views:
A) document structure - columns, paragraphs
B) document content - information for visitors.

<?xml version="1.0" encoding="windows-1250"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">

<head>
<title>Tim, the clever boy (how to design a good web)</title>
<meta http-equiv="content-type" content="text/html;
charset=windows-1250" />
<meta http-equiv="Content-language" content="cs" />
<meta name="description" content="Petr Chlebek" />
<meta name="keywords" content="web, page, education, course" />
</head>

<body>
<p>Document Content</p>
</body>

</html>

Up

Important XHTML attributes

1. DTD (Document Type Definition)

XHTML 1.0 is in three DTD forms:
A. Strict - the most strict form in XHTML
B. Transitional - floating form between HTML and XHTML
C. Frameset - the norm for pages with frames

2. Elements correctly nested

The elements don´t be crossed. It has to be evident, which elements are inside and which ones are outside. Don´t cross!

3. Closing tags

No matches tags exist. All elements are terminated by closing tags.

4. Empty tags

No matches tags are closed all the time. The common tags: br, hr, meta, img. They are terminated by the space and the slash.

5. No capital fonts

No tags can be formed by capital letters. It is important to discern tags and content. In the page content we use capital letters currently.

6. Commas are compulsory

The attribute values have to be written in commas. It means: align="center". The align is a value, the center is an atribute. And this one must be in commas.

These attributes are the simplest parts of XHTML document. They are in each Web construction.

Up