WBOY
Release: 2016-09-14 09:24:12
Original
1356 people have browsed it

Definition and usage

All browsers support the declaration.

The

declaration must be the first line of the HTML document, before the tag .

The

declaration is not an HTML tag; it is a instruction that instructs the web browser as to which version of HTML the page should be written in.

In HTML 4.01, the declaration references a DTD, because HTML 4.01 is based on SGML(Standard Generalized Markup Language). DTD (document type definition) specifies the rules of a markup language so that browsers can render content correctly.

HTML5 is not based on SGML, so there is no need to reference a DTD.

Tip: Always add the declaration to your HTML document so the browser knows the document type.

There are three types of declarations (Strict, Transitional, Frameset) in HTML 4.01. In HTML5 there is only one:

<!DOCTYPE html>
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template