![]()
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
IntroductionThe basic structure of HTML pages has changed with HTML versions. At the beginning, HTML pages were quite simple, but as HTML has been completed, pages have taken a more subtle but still simple structure. What follows deals with the latest HTML4 recommendations. Important point: from the beginning, HTML specifications have specified that a web browser that do not recognize a tag must ignore it (and not display an error message). This steadies a minimum of compatibility between the different versions. One must not be "scared" by using and adding meta tags and the <!DOCTYPE> tag at the binning of documents (see below). Elementary structureWhatever the HTML4 page, the code structure is always and must be the same:
DescriptionThe ordinary HTML page has 2 main parts: the first line (!!) and the rest of the document (delimited by the <HTML> and </HTML> tags), which part is also splitted into two other parts: the heading and the body of the page. <!DOCTYPE...>The very first line (<!DOCTYPE>) indicates to the browser which HTML version is used for this document. This version is described in a formal way in DTDs (Document Type Declaration). This first line do not but points to a location (URI) where to find the currently used DTD (in this case, it is on the W3C web site). There are 3 DTDs:
In any case, this tag must be the very first one. By default, and in doubt, it is highly recommended to use the HTML 4.01 Transitional DTD for conventional pages, and the HTML 4.01 Frameset DTD for pages that described frame structures. HTML versions prior to the HTML3 did not use this first line. The HTML page was then limited to the part defined in <HTML>...</HTML>. It is still possible to omit this line and use HTML4 tags (web browsers do not complain), but in such a case, the HTML page is no longer compliant with the W3C specifications. Heading (<HEAD>)The HTML page's heading (follows immediately the <!DOCTYPE...> tag) is delimited by the <HEAD> and </HEAD> tags. This part contains the so called meta information: it is information about the information contained in the body of the HTML page. For instance, one indicates there information about the author of the page, the date of creation, keywords or a description of the content of the page (it is very useful to reference one's pages in search engines), but one can also put HTTP directives that will be used to forward the web page. This part contains also the page's title, and possibly other elements, like style sheets or JavaScript code. This part is a kind of rag-bag where put what is not directly something to display. The <HEAD> tag, like the <HTML> tag, does not accept attributs. Page body (<BODY>)This part is delimited by the <BODY> and </BODY> tags. It contains the content of the web page, what should be displayed by the web browser. HTML tags (other than <HEAD>, <BODY>, <HTML> and <META>) are exclusively used in this part to format the document. However, it is still possible to write JavaScript code, but it is not the best place to do that (some browsers may not execute it correctly). This tag, in older versions, used attributes (background, text...). Nevertheless, these attributes have been declared deprecated and have been replaced by style sheets. Reminder of most important elements
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Copyright © 2000-2002 themanualpage.org - This site is submissive to the terms of the GNU GPL and FDL licences. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||