DelphiFAQ Home Search:

What is this DOCTYPE good for?

 

commentsThis article has not been rated yet. After reading, feel free to leave comments and rate it.

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">



Comments:

2012-11-18, 21:20:34
bgbghnh  
http://www.elitepat..ead-jersey Danny Woodhead Jersey
http://www.elitepat..rty-jersey Devin McCourty Jersey
http://www.elitepat..wer-jersey Dont\'a Hightower Jersey
http://www.elitepat..yar-jersey Irving Fryar Jersey
http://www.elitepat..ayo-jersey Jerod Mayo Jersey
http://www.elitepat..nah-jersey John Hannah Jersey
http://www.elitepat..man-jersey Julian Edelman Jersey
http://www.elitepat..ulk-jersey Kevin Faulk Jersey
http://www.elitepat..ton-jersey Kyle Arrington Jersey
http://www.elitepat..ins-jersey Logan Mankins Jersey
http://www.elitepat..der-jersey Nate Solder Jersey
http://www.elitepat..ung-jersey Patrick Chung Jersey
http://www.elitepat..ich-jersey Rob Ninkovich Jersey
http://www.elitepat..ell-jersey Ryan Wendell Jersey
http://www.elitepat..mer-jersey Sebastian Vollmer Jersey
http://www.elitepat..ski-jersey Stephen Gostkowski Jersey
http://www.elitepat..ley-jersey Stevan Ridley Jersey
http://www.elitepat..ory-jersey Steve Gregory Jersey

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: