html5 Site Icon CSS3 Site Icon CSS Site Icon

HTML4 Reference

HTML <!DOCTYPE> tag

Definition

The <!DOCTYPE> tag lets the browser know which version of HTML/XHTML we are using.

Example


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 

<html  xmlns="http://www.w3.org/1999/xhtml">
Everything goes between the start and end HTML tags. 

<head>
The header contains meta information pertaining to the HTML document as well 
as a title and other stuff we will discuss in HTML4 Intermediate/Advanced lessons.
External files such as CSS stylesheets and JavaScript files are also imported in
the header section of our HTML file.
<title>
A Title which will appear in the Windows title bar.
</title>
</head>

<body>
The content of the web page appears in the body section.
</body>

</html>
We complete the HTML file with the closing HTML tag.

HTML Doctypes Available From the W3C Recommendations

HTML 4.01 Frameset

Contains all HTML elements.
Framesets are allowed by this DTD.


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

Use this if for some strange reason you want to use frames and you turn into a werewolf on a full moon.
Not Recommended.

HTML 4.01 Transitional

Contains all HTML elements INCLUDING deprecated and presentational elements.
Framesets are not allowed by this DTD.


<!DOCTYPE html PUBLIC "-//W3C//DTD 4.01 Transitional//EN"  
         "http://www.w3.org/TR/html4/loose.dtd"> 

Generally used for legacy code where deprecated elements are still used.

HTML 4.01 Strict

Contains all HTML elements EXCLUDING deprecated and presentational elements.
Framesets are not allowed by this DTD.


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

If you wanna use HTML instead of XHTML, then this is the baby for you.
Recommended.

XHTML Doctypes Available From the W3C Recommendations

XHTML 1.0 Frameset

Contains all HTML elements.
Framesets are allowed by this DTD.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"  
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> 

Use this if for some strange reason you want to use frames and you still believe in the tooth fairy.
Not Recommended.

XHTML 1.0 Transitional

Contains all HTML elements INCLUDING deprecated and presentational elements.
Framesets are not allowed by this DTD.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

Generally used for legacy code where deprecated elements are still used.

XHTML 1.0 Strict

Contains all HTML elements EXCLUDING deprecated and presentational elements.
Framesets are not allowed by this DTD.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 

For XHTML this is supported in all browsers.
Recommended.

XHTML 1.1

Contains all HTML elements EXCLUDING deprecated and presentational elements.
Framesets are not allowed by this DTD.
Allows the use of modules.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"  
         "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 

The newest version of XHTML, but not supported in all browsers.
Recommended.

Required Attributes

N/A

Optional Attributes

N/A

Common Attributes

N/A

Language Attributes

N/A

Event Attributes

N/A



<!--...--> tag    << Prev          Next >>   <a> tag

go to home page Homepage go to top of page Top

HTML Elements

The complete set of HTML elements also known as HTML tags from the latest HTML 4.01 Specification.

Click the links for more information on individual tags and their attributes.

<!--...-->

<!DOCTYPE>

<a>

<abbr>

<acronym>

<address>

<applet>

<area />

<b>

<base />

<basefont />

<bdo>

<big>

<blockquote>

<body>

<br />

<button>

<caption>

<center>

<cite>

<code>

<col />

<colgroup>

<dd>

<del>

<dfn>

<dir>

<div>

<dl>

<dt>

<em>

<fieldset>

<font>

<form>

<frame />

<frameset>

<h1> - <h6>

<head>

<hr />

<html>

<i>

<iframe>

<img />

<input />

<ins>

<isindex />

<kbd>

<label>

<legend>

<li>

<link />

<map>

<menu>

<meta />

<noframes>

<noscript>

<object>

<ol>

<optgroup>

<option>

<p>

<param />

<pre>

<q>

<s>

<samp>

<script>

<select>

<small>

<span>

<strike>

<strong>

<style>

<sub>

<sup>

<table>

<tbody>

<td>

<textarea>

<tfoot>

<th>

<thead>

<title>

<tr>

<tt>

<u>

<ul>

<var>