Quick HTML




Standardization

An HTML document follows a standard to describe his essential properties as the HTML version used,
the character encoding, and the content description.

Document type declaration

A standard HTML document starts with a declaration that shows the HTML version used.

All documents using the HTML 4.01 Strict version start with this declaration:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
All HTML documents using frames start with this declaration instead:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd">
Note: the document declaration must be placed at the beginning of the document, before the <HTML> tag.

Character encoding META tag

The META tags describe some informations about the HTML document.

They are always in the HEAD section, just after the <TITLE> tag.

The most important information is the character encoding.
It defines the translation of the HTML file in a readable text file, depending upon his language.

The universal character encoding, suitable for all languages, is called UTF-8 (Unicode).

The encoding for the western languages is called ISO-8859-1 (Latin-1).

The corresponding META tags are:
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">

<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Below is the model of HTML structure with document type and character encoding declarations:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>   </TITLE>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
</HEAD>
<BODY>

</BODY>
</HTML>

Description and Keywords META tags

The Description META tag provides a description of the document content in form of sentence.
<META name="Description" content="A website dedicated to fruit">

The Keywords META tag provides a series of keywords related to the content of the document.
<META name="Keywords" content="apple, oranges, lemons, strawberries, food, drinks">
Note: place them in the HEAD section, after the character encoding META tag.

Search engines look for both "description" and "keywords" content when analyzing the page, and show them in the results list.


Next page :

how to set the graphic appearance of a page using a CSS (Cascading Style Sheet).


|   Back   |   Index   |   Next   |