Document Structure


An HTML 4.0 document consists of elements nested inside other elements. Each element starts with a start tag <...> and ends with an end tag </...>.

In some cases, one or both of the tags may be omitted. In general, it is safest to always include both of them. When a document is created with the help of a dedicated HTML editor, the tags are inserted automatically by the editor.

At the highest level, a document consists of one element, called HTML. Inside that are two elements, HEAD and BODY:

 <HTML>   <HEAD>...</HEAD>   <BODY>...</BODY> </HTML>

Elements can have attributes, which have a name and a value, separated by an equals sign (=). The value is enclosed in quotes ("..." or '...'). Attributes are listed only in the start tag, never in the end tag:

 <EM > <A REL='copyright' HREF='copy.html'>

Element names and attribute names can be spelled with capital or small letters, or even mixtures of the two. The previous example can also be written as follows:

 <em > <a rel='copyright' href='copy.html'>



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net