Versión en español

HTML doctype tag

Note: If you don't know what a tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.

 

Description

The HTML !DOCTYPE tag is the first thing that every HTML document should contain. The objective of this tag is to tell the browser what kind of document it's about to process.

For some versions you can find variants (Strict, Transitional and Frameset). These variants correspond to a same version, but have small differences. Usually for transitional DTDs you will find more tags and attributes available (e.g., deprecated tags and attributes in HTML 4.01 or the "target" attribute for the HTML a tag) and in Strict DTDs you will have to obey more rules. The Framset DTDs are used in pages with frames.

Here is a list of some !DOCTYPE declarations that you can use in your documents. We strongly recommend you to write XHTML code, if possible Strict (Note that XHTML 1.1 is a newer version of the XHTML 1.0 Strict).


HTML 2.0

Code begin <!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">Code end
 


HTML 3.2

Code begin <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">Code end
 


HTML 4.01: Strict, Transitional and Frameset

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

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

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


XHTML 1.0: Strict, Transitional and Frameset

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

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

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


XHTML 1.1

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


MathML 1.01

Code begin <!DOCTYPE math SYSTEM "http://www.w3.org/Math/DTD/mathml1/mathml.dtd">Code end
 


MathML 2.0

Code begin <!DOCTYPE math PUBLIC "-//W3C//DTD MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/mathml2.dtd">Code end
 


XHTML + MathML + SVG

Code begin <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">Code end
 


SVG 1.0

Code begin <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">Code end
 


SVG 1.1: Full, Basic and Tiny

Code begin <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">

<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">Code end
 


Attributes

This tag does not have any attribute.


Events

There are no events defined for this tag.

See complete list and information about events in HTML


Bypass footer options Send to a friend Send to a friend