HTML 5: root element, title, metadata element, script element

Source: Internet
Author: User
Tags script tag set cookie

HTML 5: root element, metadata element, script element

    • root element-DOCTYPE, HTML
    • Meta data Elements-head, title, base, link, Meta, style
    • Scripting elements-Script, NoScript

1,<! DOCTYPE HTML;, document type

2,<html lang= "ZH-CN"; the root element of the document

3. Head -header container.

Head-header container that can contain the following tags: title, base, link, Meta, style, script. One must have a title tag.

4,<title> I am title </titles>

5,<base href= "http://pic.cnblogs.com/avatar/" target= "_blank" /> Set default address and link default opening for a document

6,<link rel= "stylesheet" type= "text/css" href= "http://www.www.www/ Css.css " />

Link defines the connection of two files, which is generally used for the introduction of style sheet files.

rel-Specifies the relationship between documents, and the value of this property is stylesheet for the style sheet. The link tag must have a rel attribute.

The type of document that the type-is connected to.

The address of the document to which the href-is connected.

Title-the title of the document being accessed, for the stylesheet, you can specify the title of the default style sheet in meta, so that only the style sheet with the specified title is used.

Disabled,rellist (Read only), media,hreflang,sizes (Read only)

7. Meta-document-related meta-data

The META tag is an accessible tag in the head area of the HTML language that is located between the the META tag has two important properties: HTTP header information (HTTP-EQUIV) and page description information (name).

The name attribute is a description of the Web page, which corresponds to content (Web page contents), so that search engine robots find, classify, and currently almost all search engines use online robots to automatically find meta values to classify the Web page. the META tag's Name property syntax format:


Meta-document-related metadata. The following properties are available: Name, HTTP-EQUIV, content, CharSet
• <meta name= "keywords/description/generator/author/application-name/" content= "" >
<meta http-equiv= "content-language/content-type/default-style/refresh/set-cookie/prama/cache-control/ Expires/windows-target/viewport "content=" >
<meta charset= "" >

<!--
HTTP-EQUIV, the sample content combination is as follows (not all)
-
<!--Define the language of the document content-
<MetaHttp-equiv= "Content-language"Content= "ZH-CN"/>
<!--Define the type of document content-
<MetaHttp-equiv= "Content-type"Content= "Text/html"/>
<!--Defines the title of the style sheet used by the document, so that only the style sheet of the specified title is used when there are multiple style sheets. In this case, only the style sheet with the title Css1 is enforced.-
<MetaHttp-equiv= "Default-style"Content= "Css1"/>
<!--The document is refreshed every 100 seconds-
<MetaHttp-equiv= "Refresh" Content= "/>
Span style= "COLOR: #008000" ><!-- set Cookie-->
Span style= "COLOR: #0000ff" ><meta http-equiv= "Set-cookie" Content= "author= WEBABCD; " />


<!-- Defines the encoding type of the document -->
< meta charset= "Utf-8" Span style= "COLOR: #0000ff" >>

8, style -defines the style information for the document
 style-defines the style information for the document. The available properties are as follows: Disabled, media, type, scoped 
Scoped-bool property of type, and true to indicate that the style can only be applied to the parent element of the style element and its child elements (for scoped F Alse style can only be written inside the head)
< Span style= "COLOR: #0000ff" > < Span style= "COLOR: #0000ff" > < Span style= "COLOR: #008000" > < Span style= "COLOR: #0000ff" >  9, script -to define client script 
Script-for defining client script, the available properties are as follows: SRC, async, defer, type, CharSet
Type-the MIME type of the script, this property must have
SRC-the URL address of the external script, if SRC is specified, then the script tag must be empty
CharSet-The encoding type of the script
The Defer-bool type. If true, the script executes after the page is parsed, that is, before the Domcontentloaded event, which executes in the order in which the script appears in the page, without blocking page parsing (parallel download script during interface parsing)
The Async-bool type. If true, the script is downloaded asynchronously during page parsing, and the script is executed immediately after the download (which is sure to be performed before the OnLoad event of window), without blocking page parsing (parallel download script during interface parsing)

Refer to the two-paragraph script, without async or defer, must first execute script1 and then execute SCRIPT2
If it is marked as async, assuming that the SCRIPT2 is downloaded first, script1 after the download, then the SCRIPT2 will be executed first, then the SCRIPT1

HTML 5: root element, title, metadata element, script element

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.