HTML <!DOCTYPE>



The HTML Document Type

All HTML documents must start with a <!DOCTYPE> declaration.

The declaration is not an HTML tag. It is an "information" to the browser about what document type to expect.

In HTML5, the <!DOCTYPE> declaration is simple:

<!DOCTYPE html>

In older documents (HTML 4 or XHTML), the declaration is more complicated because the declaration must refer to a DTD (Document Type Definition).

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

You can read more about document types in the <!DOCTYPE> reference.


Valid HTML Elements in Different DOCTYPES

TagHTML 5HTML 4XHTML
<a>YesYesYes
<abbr>YesYesYes
<acronym>NoYesYes
<address>YesYesYes
<applet>NoYesNo
<area>YesYesNo
<article>YesNoNo
<aside>YesNoNo
<audio>YesNoNo
<b>YesYesYes
<base>YesYesYes
<basefont>NoYesNo
<bdi>YesNoNo
<bdo>YesYesNo
<big>NoYesYes
<blockquote>YesYesYes
<body>YesYesYes
<br>YesYesYes
<button>YesYesYes
<canvas>YesNoNo
<caption>YesYesYes
<center>NoYesNo
<cite>YesYesYes
<code>YesYesYes
<col>YesYesNo
<colgroup>YesYesNo
<datalist>YesNoNo
<dd>YesYesYes
<del>YesYesNo
<details>YesNoNo
<dfn>YesYesYes
<dialog>YesNoNo
<dir>NoYesNo
<div>YesYesYes
<dl>YesYesYes
<dt>YesYesYes
<em>YesYesYes
<embed>YesNoNo
<fieldset>YesYesYes
<figcaption>YesNoNo
<figure>YesNoNo
<font>NoYesNo
<footer>YesNoNo
<form>YesYesYes
<frame>NoNoNo
<frameset>NoYesNo
<h1> to <h6>YesYesYes
<head>YesYesYes
<header>YesNoNo
<hr>YesYesYes
<html>YesYesYes
<i>YesYesYes
<iframe>YesYesNo
<img>YesYesYes
<input>YesYesYes
<ins>YesYesNo
<kbd>YesYesYes
<label>YesYesYes
<legend>YesYesYes
<li>YesYesYes
<link>YesYesYes
<main>YesNoNo
<map>YesYesNo
<mark>YesNoNo
<meta>YesYesYes
<meter>YesNoNo
<nav>YesNoNo
<noframes>NoYesNo
<noscript>YesYesYes
<object>YesYesYes
<ol>YesYesYes
<optgroup>YesYesYes
<option>YesYesYes
<output>YesNoNo
<p>YesYesYes
<param>YesYesYes
<pre>YesYesYes
<progress>YesNoNo
<q>YesYesYes
<rp>YesNoNo
<rt>YesNoNo
<ruby>YesNoNo
<s>YesYesNo
<samp>YesYesYes
<script>YesYesYes
<section>YesNoNo
<select>YesYesYes
<small>YesYesYes
<source>YesNoNo
<span>YesYesYes
<strike>NoYesNo
<strong>YesYesYes
<style>YesYesYes
<sub>YesYesYes
<summary>YesNoNo
<sup>YesYesYes
<table>YesYesYes
<tbody>YesYesNo
<td>YesYesYes
<textarea>YesYesYes
<tfoot>YesYesNo
<th>YesYesYes
<thead>YesYesNo
<time>YesNoNo
<title>YesYesYes
<tr>YesYesYes
<track>YesNoNo
<tt>NoYesYes
<u>YesYesNo
<ul>YesYesYes
<var>YesYesYes
<video>YesNoNo
<wbr>YesNoNo





Post a Comment

أحدث أقدم