0% found this document useful (0 votes)
127 views9 pages

HTML5 Doctype Declaration Explained

The document discusses the HTML document type (<!DOCTYPE>) declaration which indicates the type of document to the browser. In HTML5, the declaration is simply <!DOCTYPE html>. Older HTML and XHTML documents have more complex declarations that refer to a DTD. The document also provides a table comparing which HTML elements are valid in HTML5, HTML4 and XHTML documents.

Uploaded by

Future Plant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
127 views9 pages

HTML5 Doctype Declaration Explained

The document discusses the HTML document type (<!DOCTYPE>) declaration which indicates the type of document to the browser. In HTML5, the declaration is simply <!DOCTYPE html>. Older HTML and XHTML documents have more complex declarations that refer to a DTD. The document also provides a table comparing which HTML elements are valid in HTML5, HTML4 and XHTML documents.

Uploaded by

Future Plant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

 Menu  Log in

    

HTML <!DOCTYPE>
❮ Previous Next ❯

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

Tag HTML 5 HTML 4 XHTML


<a> Yes Yes Yes

<abbr> Yes Yes Yes

<acronym> No Yes Yes

<address> Yes Yes Yes

<applet> No Yes No

<area> Yes Yes No

<article> Yes No No

<aside> Yes No No

<audio> Yes No No

<b> Yes Yes Yes

<base> Yes Yes Yes

<basefont> No Yes No

<bdi> Yes No No

<bdo> Yes Yes No

<big> No Yes Yes

<blockquote> Yes Yes Yes

<body> Yes Yes Yes

<br> Yes Yes Yes

<button> Yes Yes Yes

<canvas> Yes No No

<caption> Yes Yes Yes

<center> No Yes No

<cite> Yes Yes Yes

<code> Yes Yes Yes

<col> Yes Yes No

<colgroup> Yes Yes No


<datalist> Yes No No

<dd> Yes Yes Yes

<del> Yes Yes No

<details> Yes No No

<dfn> Yes Yes Yes

<dialog> Yes No No

<dir> No Yes No

<div> Yes Yes Yes

<dl> Yes Yes Yes

<dt> Yes Yes Yes

<em> Yes Yes Yes

<embed> Yes No No

<fieldset> Yes Yes Yes

<figcaption> Yes No No

<figure> Yes No No

<font> No Yes No

<footer> Yes No No

<form> Yes Yes Yes

<frame> No No No

<frameset> No Yes No

<h1> to <h6> Yes Yes Yes

<head> Yes Yes Yes

<header> Yes No No

<hr> Yes Yes Yes

<html> Yes Yes Yes

<i> Yes Yes Yes


<iframe> Yes Yes No

<img> Yes Yes Yes

<input> Yes Yes Yes

<ins> Yes Yes No

<kbd> Yes Yes Yes

<label> Yes Yes Yes

<legend> Yes Yes Yes

<li> Yes Yes Yes

<link> Yes Yes Yes

<main> Yes No No

<map> Yes Yes No

<mark> Yes No No

<meta> Yes Yes Yes

<meter> Yes No No

<nav> Yes No No

<noframes> No Yes No

<noscript> Yes Yes Yes

<object> Yes Yes Yes

<ol> Yes Yes Yes

<optgroup> Yes Yes Yes

<option> Yes Yes Yes

<output> Yes No No

<p> Yes Yes Yes

<param> Yes Yes Yes

<pre> Yes Yes Yes

<progress> Yes No No
<q> Yes Yes Yes

<rp> Yes No No

<rt> Yes No No

<ruby> Yes No No

<s> Yes Yes No

<samp> Yes Yes Yes

<script> Yes Yes Yes

<section> Yes No No

<select> Yes Yes Yes

<small> Yes Yes Yes

<source> Yes No No

<span> Yes Yes Yes

<strike> No Yes No

<strong> Yes Yes Yes

<style> Yes Yes Yes

<sub> Yes Yes Yes

<summary> Yes No No

<sup> Yes Yes Yes

<table> Yes Yes Yes

<tbody> Yes Yes No

<td> Yes Yes Yes

<textarea> Yes Yes Yes

<tfoot> Yes Yes No

<th> Yes Yes Yes

<thead> Yes Yes No

<time> Yes No No
<title> Yes Yes Yes

<tr> Yes Yes Yes

<track> Yes No No

<tt> No Yes Yes

<u> Yes Yes No

<ul> Yes Yes Yes

<var> Yes Yes Yes

<video> Yes No No

<wbr> Yes No No

❮ Previous Next ❯

COLOR PICKER

LIKE US



Get certified
by completing
a course today!
Get started

CODE GAME

Play Game

Report Error

Forum

About

Shop

Top Tutorials
HTML Tutorial
CSS Tutorial
JavaScript Tutorial
How To Tutorial
SQL Tutorial
Python Tutorial
W3.CSS Tutorial
Bootstrap Tutorial
PHP Tutorial
Java Tutorial
C++ Tutorial
jQuery Tutorial

Top References
HTML Reference
CSS Reference
JavaScript Reference
SQL Reference
Python Reference
W3.CSS Reference
Bootstrap Reference
PHP Reference
HTML Colors
Java Reference
Angular Reference
jQuery Reference

Top Examples
HTML Examples
CSS Examples
JavaScript Examples
How To Examples
SQL Examples
Python Examples
W3.CSS Examples
Bootstrap Examples
PHP Examples
Java Examples
XML Examples
jQuery Examples

Web Courses
HTML Course
CSS Course
JavaScript Course
Front End Course
SQL Course
Python Course
PHP Course
jQuery Course
Java Course
C++ Course
C# Course
XML Course

Get Certified »

You might also like