Struttura di un documento HTML Estrutura de um documento HTML Struktur eines HTML Dokuments Structure d'un document HTML Disposición de documentos HTML

HTML document

An HTML page is a simple file containing text formatted with HTML tags. Traditionally, the file is given an .htm or .html extension, but a web page may have other extensions as well.

A web page can be built from even the most basic text editors (such as a notepad application, for example), but there are also more advanced editors out there.

WYSIWYG ("What You See Is What You Get") editors are graphical-interface editors for working on a web page so as to better visualise what visitors to the site will see. With this kind of editor, tags can be added with just a mouseclick, and their attributes can be modified by entering their properties in a form. However, in order to get the best possible use out of this kind of editor, it helps a great deal to already have a good understanding of HTML.

There are also HTML editors which display tags, attributes, and their values in different colours in order to make them easier to read. They sometimes include tools for checking whether the HTML code is valid.

Traditionally, the file is given an .htm or .html extension, but a web page may have other extensions as well, including:

  • .asp for a page generated dynamically by ASP (Active Server Pages);
  • .cgi for a page generated dynamically with CGI (Common Gateway Interface);
  • .php, .php3 or .php4 for a page generated dynamically in PHP;
  • .pl for a page generated dynamically in Perl (Practical Extraction and Report Language);
  • etc.

HTML Document Layout

An HTML document begins with the tag <HTML> and ends with the tag </HTML>. It also contains a header describing the title of the page, and a body where the page's content is located.

The header is delimited by the tags <HEAD> and </HEAD>. The body is delimited by the tags <BODY> and </BODY>.

For example, this is a very minimalist HTML page:

<HTML>
<HEAD>
<TITLE>Page title</TITLE>
</HEAD>

<BODY>
Page content
</BODY>
<HTML>

Document Type Declaration

The HTML page should include the document type declaration, a reference to the HTML standard being used, in order to specify which coding standard the page employs. The declaration is made by adding a line like this one:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<HTML>
	<HEAD>...</HEAD>
	<BODY>Page content</BODY>
</HTML>

This indicates which DTD (Document Type Definition) is being used. The DTD is a reference to the characteristics of the language being used. The table below summarises the declarations for the main versions of HTML:

Version Declaration
HTML 2.0 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 4.0//EN">
HTML 3.2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
HTML 4.01
  • Strict: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
  • Transitional: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  • Frameset: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
XHTML 1.0
  • Strict: <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  • Transitional: <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
  • Frameset: <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
XHTML 1.1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


Last update on Thursday October 16, 2008 02:43:14 PM.This document entitled « HTML document layout » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
Best answers for « HTML document layout » in :
How to make a space in your html document Show How to make a space in your html document In HTML there is no way that the web browser can recognise the spaces inserted consecutively in between the letters. You can either try it in EI, Mozilla and Opera. The only way to do so is...
Validate a HTML document Show Validate a HTML document HTML Validator Other Validators HTML is a standard published by the W3C with relatively strict syntax rules. Respect for the standard to maximize the chances for optimal viewing on almost all browsers...
Display keyboard keys in an HTML document Show Display keyboard keys in an HTML document USB host controller When connecting a USB 2.0 device, Windows displays the following message: Install a high speed USB host controller or This device will function at reduced speed if you...
[Caml] Official tutorials and resources Show[Caml] Official tutorials and resources Home page: http://caml.inria.fr/index.en.html Documentation : Caml light : http://caml.inria.fr/pub/docs/manual-caml-light/index.html Ocaml : http://caml.inria.fr/pub/docs/manual...
How to read a .DOCX document ShowHow to read a .DOCX document Download Microsoft Compatibility Pack Download XML Translator Making use of online Tools For MAC users The new Office 2007 includes a new format for the word documents that bears the .docx extension....
Background image/ Printed Watermark with Microsoft Word ShowBackground image/ Printed Watermark with Microsoft Word Insert a background image: Insert a Printed Watermark background: You might want to customize the blank background of your Word document either to advertise your business or...
Download Microsoft Keyboard Layout Creator ShowKeyboard Layout Creator Microsoft is what you need to define your keyboard layout when Microsoft does not support your language or enter your favourite symbols in a text by a single click. Keyboard Layout Creator Microsoft widens the basic features...
Managing images in HTML ShowHow do you display images on a web page? Having a few images on a website can make it more attractive and user-friendly. However, it is important not to go overboard, since images can take a long time to load, and in some cases can make a document...
HTML Markup ShowHTML, A Markup Language HTML is not a programming language. Rather, it is used for describing the layout and format of content, written in the form of simple text. An HTML page is a basic text file containing tags for specifying text format,...
Headings in HTML ShowHeadings HTML can use six different levels of headings to define the hierarchical structure of paragraphs in a document: TagVisual...