HTML5 tagging Method

Source: Internet
Author: User

1. content type)

HTML5 is still extended to ".html#or ".htm, And the content type (contenttype) is still "text/html ".

2. doctype Declaration

<! Doctype HTML>

Version declaration cannot be used in HTML5. One document applies to all versions of HTML.

When applicable to tools, you can also add the system identifier in the doctype declaration method: <! Doctype HTML System "about: Legacy-compat"> (what does this mean ?)

3. Specify character encoding

In HTML5, you can use the <meta> element to directly append the charset attribute to specify the character encoding: <meta chshortset = "UTF-8">;

Html4 uses <meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"> to continue to work. But not both.

UTF-8 is recommended for character encoding of files in HTML5.

4. attributes with Boolean values

If you only write an attribute without specifying the attribute value, the attribute is set to true. You can also set the attribute name to the attribute value or an empty string to the attribute value. If you want to set the attribute value to false, you can skip this attribute.

5. quotation marks

When an attribute is specified, both sides of the attribute value can be enclosed in double quotation marks or single quotation marks. When the attribute value does not include characters such as null string, <","> "," = ", single quotation marks, and double quotation marks, the quotation marks on both sides of the attribute can be omitted. For example, <input type = "text"> <input type = 'text'> <input type = text>.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.