HTML 5 <!DOCTYPE> Declaration
Example
An HTML 5 document with the correct doctype:
<!DOCTYPE HTML>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
|
Try it yourself » |
Definition and Usage
The <!DOCTYPE> declaration must be the very first thing in your HTML5
document, before the <html> tag. This tag tells the browser which HTML
specification the document uses.
The doctype declaration is not an HTML tag; it is an instruction to the web browser about what version of the markup language the page is written in.
It is important that you specify the doctype in all HTML documents, so
that the browser knows what type of document to expect.
The doctype in HTML 4.01 required a reference to a DTD, because HTML 4.01 was based on SGML.
HTML 5 is not based on SGML, and does not require a reference to a DTD,
but need the doctype for browsers to behave as they should.
Differences Between HTML 4.01 and HTML 5
There are 3 different doctypes in HTML 4.01, In HTML 5 there is only one:
Tips and Notes
Note: The <!DOCTYPE> tag does not have an end tag.
Tip: The <!DOCTYPE> declaration is NOT case sensitive.

Need an easy way to get data into XML, or transform XML to another format?
MapForce lets you map XML data to/from any combination of XML, database, flat file, Excel 2007, XBRL, or Web services data.
Then it transforms data instantly or auto-generates royalty-free data integration code for recurrent conversions.
New features in Version 2010!
Download a free, fully functional 30-day trial to experience the following features:
- Easy-to-use, graphical data mapping interface
- Instant data transformation
- XSLT 1.0/2.0 and XQuery code generation
- Java, C#, and C++ code generation
- Advanced data processing functions
- Support for all major relational databases including SQL Server, IBM DB2, Oracle, and more
- Visual Studio & Eclipse integration
Download a fully-functional trial today!
|
|
|
|