HTML " < html > " Standard (Tag)

 There must be a HTML page (there will only be a) <html>label (tag), <html>the tag is the root element of the whole HTML file (root element), the entire page all the HTML elements are contained in the <html>label inside.

What a standard HTML document looks like:

<!DOCTYPE HTML>
<html>
  <head>
    <title>Title of the document</title>
  </head>
  <body>
    The content of the document
  </body>
</html>

You can see all the HTML elements are <html>sub-elements, in addition to DOCTYPE !

<html> tag attributes (Attribute)

lang

Lang is used to declare which language the text on your webpage is mainly written in, and for which area netizens are written. Lang can help screen readers to read the text correctly and also help search The engine understands your text content.

For example, the lang attribute can have values ​​like:

  • <html lang="en"> Means English
  • <html lang="zh-Hant"> Means traditional Chinese
  • <html lang="zh-Hans"> Means simplified Chinese
  • <html lang="zh-Hans-HK"> Indicates simplified Chinese used in Hong Kong

It can be seen that the rule for the value of lang is to separate "language-script-region" (language-script-region) with -:

  • The language/language can refer to the IETF language tag specification, usually in lowercase English
  • The script/font can refer to the ISO 15924 script codes specification
  • Among them, the region/region can refer to ISO 3166 country codes , usually in English capital

Post a Comment

0 Comments