HTML+CSS Easy to get started with HTML declarations

    

All browsers support html declaration

Definition and usage

The declaration must be the first line of the HTML document, located in < before the ;html> tag. The

declaration is not an HTML tag; it is an instruction to 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. A DTD specifies the rules for 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.

Differences between HTML 4.01 and HTML5

There are three types of declarations in HTML 4.01. There is only one in HTML5:

##Next let’s look at 3 of html4.01 A declaration method:

1.

This DTD contains all HTML elements and attributes, except presentational and deprecated elements (such as font). Framesets are not allowed. Markup must be written in well-formed XML.

2.

This DTD contains all HTML elements and attributes, including presentational and deprecated elements (such as font). Framesets are not allowed. Markup must be written in well-formed XML.

3.

This DTD is equivalent to XHTML 1.0 Transitional, but allows frameset content.


At present, most of us use

This simplifies the code segment

Continuing Learning
||
欢迎学习html!
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!