DelphiFAQ Home Search:
General :: Web publishing
Information about web publishing, how to maintain, optimize and promote a web site.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

What is this DOCTYPE good for?

Question:

What is the purpose of the <!DOCTYPE ..> tag in HTML pages and what should I put in there?

Answer:

The <!DOCTYPE ..> tag is a special declaration in the very first line of your webpage, it comes even before the <HTML> tag. This tag informs a validator tool what rules to use when it has to validate your page. Newer browsers (IE 6+, Mozilla, NS6+, Opera, IE 5+ on Mac) use this setting to determine whether to display your page in 'Quirks' or 'Standards' mode.

Visit this web site to try an online validator:

http://validator.w3.org/

// HTML 4.01 transitional doctype supports all attributes of HTML 4.01,
 // presentational attributes, deprecated elements, and link targets.
 // It is meant to be used for webpages that are transitioning to HTML 4.01 strict:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 
 
 // HTML 4.01 Strict is a trimmed down version of HTML 4.01 with emphasis on 
 // structure over presentation. Deprecated elements and attributes
 // (including most presentational attributes), frames, and link
 // targets are not allowed. CSS should be used to style all elements:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 "http://www.w3.org/TR/html4/strict.dtd">
 
 
 // HTML 4.01 frameset is identical to Transitional above,
 // except for the use of <frameset> over <body>:

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
 "http://www.w3.org/TR/html4/frameset.dtd">
 
 
 

Generated 12:02:32 on Aug 19, 2019