HyperText Markup Language (HyperText Markup Language), the full name of HTML, was invented by Tim Berners-Lee, the father of the World Wide Web, in the 1990s. It is a Markup Language used to structure Web pages and their content. When a browser visits a web page, it downloads HTML code from a server and renders the page.
HTML hands type
Create a new HTML file in the editor and type! By pressing Tab, Emmet automatically completes the basic structure of the HTML as follows:
<! DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta <title>Document</title> </head> <body> </body> </body> </ HTML >Copy the code
represents a document type declaration that tells the browser how to parse the page.
The < HTML > tag is the root element of the page, and all other elements are its children. A web page can have only one < HTML > tag. The label lang indicates the default language of the web page. To display Chinese by default, set en to zh-cn.
Some meta information placed on a web page that does not normally appear on a web page.
<meta>
To set up some metadata for the web page,<meta charset="UTF-8">
Understand the character encoding of the current document (the character encoding declaration should be consistent with the actual character encoding used in the document, otherwise garbled characters will appear).<meta http-equiv="X-UA-Compatible" content="IE=edge">
The display tells IE to use the latest browser kernel.< meta name = "viewport" content = "width = device - width, initial - scale = 1.0" >
Disable zoom, compatible with mobile phones.user-scalable=no
thiscontent
To disable scaling,name=viewport
的meta
The label is used for viewport Settings.
*
Common labels
Table chapter labels
To represent the page hierarchy, here are some common table chapter tags:
-
~
defines headings from large to small.
-
represents a separate section that contains a topic, usually a chapter of a web page.
-
represents a separate structure within a document, page, application, or website.
-
is used to represent the header of a web page or an article or block. A page can contain multiple , but a specific scene can contain only one .
-
represents the end of a web page or article.
-
represents the body of a web page. Only one page can be created.
-
represents a paragraph in the text.
-
-
is used for partitioning and does not semantically represent anything specific.
Labels for table contents
<ol>
和<li>
Ordered list, two tags to use nested
< ol > < li > list 1 < / li > < li > list 2 < / li > < li > list 3 < / li > < / ol >Copy the code
Render as follows
<ul>
和<li>
Unordered list, two tags to use nested
< ol > < li > list 1 < / li > < li > list 2 < / li > < li > list 3 < / li > < / ol >Copy the code
Render as follows
<dl>, <dt>, <dd>
The < DL > tag is a list of descriptions, with terms defined by < DL > and terms defined by < DD >.
< dl > < dt > CPU < / dt > < / dd > < dd > the CPU < dt > < / dt > Memory Memory < / dd > < dd > < dt > Hard Disk < / dt > < / dd > < dd > Hard drive < / dl >Copy the code
Render as follows
<pre>
HTML reduces successive Spaces or carriage returns to a single space. If you want to keep these Spaces, place them inside
.
<code>
Used to display computer code, the default isometric font display. If you want to show more than one line of code, put it inside
.
-
represents the dividing line.
-
is used to wrap a line
-
< em > and < strong >
<quote>
和<blockquote>
is an inline reference, and < blockQuote > is a block-level reference.
Global properties
Global attributes are attributes that any tag has. Here are some common global attributes:
class
Attribute is used to classify tags. A tag can have multiple tagsclass
, separated by a space.contenteditable
Property allows the user to modify the content of an HTML page (the content of an HTML page is not editable by default).hidden
If an element sets this property, it will not be displayed.id
Property defines a unique identifier for the entire document. It can be used to add styles to CSS and to get elements in JS.style
Property to specify the CSS style of the current element. It has a higher priority than CSS, but is overwritten by JS.tabindex
Property allows the user to TAB through web elements. The property is a positive integer and will be executed in terms of 1, 2, 3… In order to traverse; Property value is 0, indicating the last access; If the value of the property is a negative integer, it indicates no access.title
Attribute is used to add additional description to an element that is displayed when the mouse hovers over the elementtitle
Property value of.