Link:http://output.to/sideway/default.asp?qno=100800027 Structure Elements HTML Structure
The first section of a HTML document is a line of delcaration used to declare
the document type.
Code Sample::
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>TITLE</title> ..... </head> <body> <h1>HTML</h1> <p>A Web Page Sample</p> ..... </body> </html>
Code Sample:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>TITLE</title> ..... </head> <body> <h1>HTML</h1> <p>A Web Page Sample</p> ..... </body> </html>
Code Sample:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd"> <html> <head> <title>TITLE</title> ..... </head> <frameset cols="50%,50%"> <frame src="frame_left.htm"> <frame src="frame_right.htm"> ..... </frameset> </html>
<!DOCTYPE>
<!DOCTYPE> is a tag used for document type declaration. It must be the first line of a HTML document and
is used to specify what version of HTML is used in the document. For HTML 4.01
specification, there are three DTDs.
child elements:
---
attributes:
HTML PUBLIC "FPI" ["URL"]
events:
---
HTML 4.01 Strict DTD:
The Strict DTD allows the using of all elements and attributes, except those are outdated. Frameset is also not allowed. HTML Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
HTML 4.01 Transitional DTD:
The Transitional DTD allows the using of all Strict DTD elements and attributes, including those outdated elements and attributes. Frameset is not allowed also.
HTML Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
HTML 4.01 Frameset DTD:
The Frameset DTD allows the using of all Transitional DTD elements and attributes, but allowing the usage of frameset." HTML Code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
open tag: <html> end tag: </html>
The <html> element is the root element used to contain all the content of an HTML document except the <DOCTYPE> element. And the <html> element should be placed after the <DOCTYPE> element.
child elements:
( <head>, ( <body> | <frameset> ) )
attributes:
lang dir version
events:
---
<head>
open tag: <head> end tag: </head>
The <head> element is used to contain the related infromation of the HTML document. Elements within the head section are manudipated through other mechanism and they are usually not for direct rendering. Elements are used to define title, keywords, ... etc. But only the <title> element is required in every HTML document.
child elements:
( ( <title> ) & ( <isindex> )? & ( <base> )? ) +( <script> | <style> | <meta> | <link> | <object> )*
attributes:
lang dir profile
events:
---
<body>
open tag: <body> end tag: </body>
The <body> element is used to contain the content of the HTML document. Elements within the body section are manudipated by a user agent for presentation. Elements of the HTML document content can be text, images, table, hyperlinks, etc. Elements are used by a browser for rendering in a web page.
child elements:
( ( <p> | ( <h1> | <h2> | <h3> | <h4> | <h5> | <h6> ) | ( <ul> | <ol> | <dir> | <menu> ) | ( <pre> ) | <dl> | <div> | <center> | <noscript> | <noframes> | <blockquote> | <form> | <isindex> | <hr> | <table> | <fieldset> | <address> ) ( * | + ) | ( ( #PCDATA ) | ( <tt> | <i> | <b> | <u> | <s> | <strike> | <big> | <small> ) | ( <em> | <strong> | <dfn> | <code> | <samp> | <kbd> | <var> | <cite> | <abbr> | <acronym> ) | ( <a> | <img> | <applet> | <object> | <font> | <basefont> | <br> | <script> | <map> | <q> | <sub> | <sup> | <span> | <bdo> | <iframe> ) | ( <input> | <select> | <textarea> | <label> | <button> ) )( * | + ) ) +( <ins> | <del> )*
attributes:
id class style title lang dir background bgcolor text link vlink alink
events:
onclick ondbclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup onload onunload
<frameset>
open tag: <frameset> end tag: </frameset>
The <frameset> element is used to contain multiple HTML documents in one HTML document within the same window. The <frameset> element only defines the arrangement of HTML documents. Each HTML document is hold by a <frame> element. The multiple views arrangement allows the management of each HTML document individually in a web page. Therefore the <body> element cannot be used together with the <frameset> in the same level.
child elements:
( ( <frameset> | <frame> )+ & ( <noframes> )? )
attributes:
id class style title rows cols
events:
onload onunload
required
Optional tag
Deprecated
Transitional
Frameset
Exclusion
Optional Element or Content Occurrence Character: (+) one or more; (*) zero or more; (?) zero or one times; ( ) exactly once Choice or Sequence Element or Content : (|) or (&) and (,) sequence (+) include (-) exclude |
Sideway BICK Blog 20/08 |