bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/HTML/Reference and Practice
HTML•Reference and Practice

HTML <!DOCTYPE>

Concept visual

HTML <!DOCTYPE>

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

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).

Formula

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

Previous

HTML Interview Preparation

Next

W3Schools HTML Bootcamp