Page Structure
The skeleton for every web page you create should look like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> </head> <body> <!-my website content goes here (this is a comment)--> </body> </html>
The first item is called a Document Type Definition (DTD).
The DTD is one of the most important tags in a web document. The <!DOCTYPE> is the very fist tag in your document, it comes before the opening <html> tag. The DTD tag tells the browser what version of HTML the document is using. This tag should not be closed at the end of the document.
There are three different DTD tags used in HTML.
The most common <!DOCTYPE> tag to use is the Transitional DTD:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
The transitional DTD is good for beginners as it allows you to validate a document less stringently.
"This is the HTML 4.01 Transitional DTD, which includes presentation attributes and elements that W3C expects to phase out as support for style sheets matures. Authors should use the Strict DTD when possible, but may use the Transitional DTD when support for presentation attribute and elements is required." taken from w3.org
Another <!DOCTYPE> tag you will see is Strict. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
"This is HTML 4.01 Strict DTD, which excludes the presentation attributes and elements that W3C expects to phase out as support for style sheets matures. Authors should use the Strict DTD when possible, but may use the Transitional DTD when support for presentation attribute and elements is required." taken from w3.org
One Last <!DOCTYPE> tag you will use is Frameset but we're not going to cover frames in these tutorials. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
This is the HTML 4.01 Frameset DTD, which should be used for documents with frames. This DTD is identical to the HTML 4.01 Transitional DTD except for the content model of the "HTML" element: in frameset documents, the "FRAMESET" element replaces the "BODY" element. taken from w3.org
REMEMBER - the <!DOCTYPE> tag you will use the most is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
The HTML tag tells the browser what language the page is written in. The opening <HTML> tag should always be the second line of your document, right after the DTD. The closing line of your document should always be your closing