"; the meta tag is used to provide metadata about the HTML document. When the charset attribute is added to the tag, the character encoding of the HTML document can be specified.">
html5 The statement to set the character set is " "; the meta tag is used to provide metadata about the HTML document. When the charset attribute is added to the tag, it can be specified The character encoding of the HTML document.
The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.
In HTML5, you can use the tag to set the character set.
tag is used to provide metadata about the HTML document, such as page validity period, page author, keyword list, page description, etc. The data defined by the tag will not be displayed on the page, but will be parsed by the browser.
tag defines the syntax of the character set:
The charset attribute is used to specify the character encoding of the HTML document, for example, added in thetag The following statement:
can set the character encoding of the document to "UTF-8".
Differences between HTML 4.01 and HTML5
The charset attribute is a new attribute in HTML5 and replaces:
Still allows the use of the http-equiv attribute to specify the character set, but using the new method can reduce the amount of code.
Commonly used values for the charset attribute:
UTF-8 - Unicode character encoding
ISO-8859 -1 - Character encodings for the Latin alphabet
In theory, any character encoding can be used, but not all browsers understand them. The more widely a certain character encoding is used, the more likely browsers are to understand it.
To see all available character encodings, visit IANA Character Sets.
http://www.iana.org/assignments/character-sets
Expand knowledge: Other uses of tags
1. Define page description
Defining the description information of the page is beneficial to search engines.
tag defines the document title, name="description" defines the document description, and the description is usually longer than the title.
2. Define keywords
Keywords are used to provide search engines with information related to the page.
3. Define page author
Author information can be automatically extracted through some content management systems.
4. Refresh the page
The code in the above example is used to send an instruction to the browser so that the browser automatically refreshes the page after a specified time interval (30 seconds). In addition to specifying the time interval in the content attribute, you can also specify a link. In this case, the page will redirect to the page pointed to by the link after the specified time, as shown in the following example:
Related recommendations : "html video tutorial"
The above is the detailed content of What is the statement to set the character set in html5. For more information, please follow other related articles on the PHP Chinese website!