Html header structure and example

Source: Internet
Author: User

From: http://www.cnblogs.com/FlyCat/archive/2012/06/27/2566325.html

 

Code:

HTML header Structure
 
<Html>
<Head>
<! --
The base tag specifies the default address or default destination for all links on the page.
Generally, the browser extracts the corresponding elements from the URL of the current document to construct a new relative URL.
You can use the <base> label to change the value. The browser will no longer use the URL of the current document, but use the basic URL specified by <base>
As a relative URL. These include the URLs in the <a>, , <link>, and <form> labels.

In HTML, the <base> tag does not have an ending tag. In XHTML, the <base> tag must be properly disabled.
<Base> the tag must be inside the head element.

Optional properties of target
_ Blank
_ Parent
_ Self
_ Top
Framename
For example, setting target to _ blank makes all the connections on the page open in a new window.
-->
<Base href = "http://www.w3school.com.cn/ I/"/>
<Base target = "_ blank"/>

<! --
The meta tag attribute defines the name/value pairs associated with the document.
When the attribute is http-equiv, the value can be content-type, expires, refresh, set-cookie, etc. The content attribute is associated with the HTTP header.
When the attribute is name, the value can be author, description, keywords, generator, revised, others, etc. The content attribute is associated with a name.
-->
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<! --
Charset sets the file encoding of the webpage, not necessarily UTF-8, or gb2312, gbk, etc., and is modified according to the actual situation.
Content-type, which can be mime/subtype, usually text/html or image/jpg.
-->
<Meta http-equiv = "expires" content = "2005/05/05 18:00:00">
<! -- Offline browsing expiration time -->
<Meta http-equiv = "pragma" content = "no-cache">
<! -- Disable webpage reading from cache -->
<Meta http-equiv = "Refresh" content = "5; http://users7.nofeehost.com/luan123/">
<! -- Webpage redirection -->
<Meta http-equiv = "set-cookie" content = "2005/05/05 18:00:00">
<! -- Set the cookie expiration time for a webpage -->
<Meta http-equiv = "Window-target" content = "_ top">
<! -- Set the target window of the link on the webpage -->
<Meta http-equiv = "Page-Enter" content = "revealTrans (duration = 1000000, transition = 50000000)">
<! -- Set the webpage opening effect -->
<Meta http-equiv = "Page-Exit" content = "revealTrans (duration = 1000000, transition = 50000000)">
<! -- Set the Closing effect of the webpage -->

<Meta name = "keywords" content = "overmind, zerg, protoss">
<! -- Set the keyword of the webpage. The search takes precedence !!! Important !!! The data is indexed by the search engine -->
<Meta name = "description" content = "Haha">
<! -- INSERT description into the index by the search engine when searching -->

<Title> untitled document </title>
<! -- <Title> A tag is the only requirement of a
<Link rel = "stylesheet" type = "text/css" href = "/html/csstest1.css">
<! --
In HTML, the <link> tag has no ending tag.
In XHTML, the <link> label must be properly disabled.
<Link> the tag defines the relationship between the document and external resources.
<Link> the most common use of a tag is to link a style sheet.
The link element is an empty element and contains only attributes.
This element can only exist in the head part, but it can appear any number of times.
Standard attributes
Id, class, title, style, dir, lang, xml: lang
-->
<Style type = "text/css">
H1 {color: red}
P {color: blue}
</Style>
<! --
<Style> tags are used to define style information for HTML documents.
In style, you can specify how HTML documents are rendered in a browser.
The type attribute is required to define the content of the style element. The only possible value is "text/css ".
The style element is located in the head section.

All mainstream browsers support <style> labels.
-->

<Script type = "text/javascript" src = "myscripts. js"> </script>
<Script type = "text/javascript">
Document. write ("Hello World! ")
</Script>
<! --
<Script> tags are used to define client scripts, such as JavaScript.
The script element can contain script statements or direct to an external script file through the src attribute.
The required type attribute specifies the MIME type of the script.
Common JavaScript applications include image operations, form verification, and dynamic content updates.

If the code inside the element is not in a function, the code will be executed immediately when the page is loaded. <Frameset> scripts after tags are ignored.
See the noscript element. This element is useful for users who disable scripts in their browsers or their browsers do not support client scripts.
-->

<Noscript> Your browser does not support JavaScript! </Noscript>
<! --
The noscript element is used to define alternative content (text) when the script is not executed ).
This label can be used by browsers that recognize the <script> label but cannot support the script.
Note: If the browser supports scripts, it will not display the text in the noscript element.
Note: browsers that cannot identify the <script> tag will display the TAG content on the page. To prevent the browser from doing this, you should hide the script in the annotation tag. Older browsers that do not recognize <script> tags ignore comments, so that the content of tags is not written to the page, while new browsers know how to execute these scripts, even if they are surrounded by comment labels!
-->

</Head>
<Body>
Aaa
</Body>
</Html>

Complete!

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.