Document Type Declarations
DTD
Explanation page
W3C
Doctype Use (HTML Version Information)
At the very top of your HTML file, you put a DOCTYPE in a special comment,
even before you put the <HTML> tag. This tells the browser what
version of HTML you are using, and also points to the special file that
defines the DTD or "Document Type Declaration". While you don't always
need this, with things like XML coming on the scene, it is becoming more
and more crucial. That, and web validation services, (a few are listed on
HTML References) demand them if you
want to be an "official HTML 4.0" page.
For XHTML 1.0 Transitional, put this at the top
(Note how this also replaces the <html> tag)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
lang="en"xml:lang="en">
NOTE: This replaces your regular opening <html> tag, so remember to
delete that, and then put
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"
/>
inside the <head> tags next to the <title> tags.
And you can go to The W3C
validator to test the pages.
For pure HTML 4.0 documents. Style sheets, NO deprecated tags or
attributes.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
For documents that use some HTML 4.0 elements, but still use
deprecated tags
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
For all of the above, but with Frames being used.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN"
"http://www.w3.org/TR/REC-html40/frameset.dtd">
|