An analysis of HTML file head internal tag

Source: Internet
Author: User
Tags add version valid

Today, it's easy to make a home page with all the WYSIWYG tools. But understanding the HTML source code and syntax is undoubtedly more helpful for us to make the homepage, and can also enable the user to control the effect of the page more precisely. There are a lot of articles about HTML syntax, but there are a few other tags in the head besides the title tag. Although these tags are not commonly used, but we need to have a certain understanding of them.

OneMETA

Meta tags are used to describe some document information that is not included in standard HTML. The fierce competition has enabled browser vendors to use Meta to develop many useful features and make these features available in commonly used browsers. Here are a few useful uses:

*<meta name= "keywords" content= "Yourkeyword" >
<meta name= "description" content= "your homepage ' s description" >
of this pageKeywords and Descriptions。 After adding these definitions to the page, some search engines will be able to get readers to find your home page based on these keywords, and get to know your home page content.

* <meta http-equiv= "refresh" content= "60; Url= "New.htm" >
The browser will be in 60 seconds,Automatic SteeringTo New.htm. You can use this feature to create a cover page that automatically brings readers to your catalog after a few hours.
If the URL entry is not there, the browser refreshes this page. This realizes the characteristic that the WWW chat room refreshes regularly.

* <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
   describe the language used on this page。 Depending on this, the browser can choose the correct language encoding without requiring the reader to select it in the browser. GB2312 refers to the simplified Chinese, while the home page of BIG5 in Taiwan is BIG5.

* <meta http-equiv= "Pragma" content= "No-cache" >
   mandatory call to the latest version of the Web。 To save time, the browser saves a temporary version of a Web file on your local hard drive. When you want to recall, directly display the files on the hard drive, not on the web. If you want the reader to see the latest version every time, add this sentence.

TwoLINK

Displays the connection between this document and other documents. One of the most useful applications is the positioning of external cascading style sheets. The format is as follows:

<link rel= "stylesheet" href= "Style.css" >

The rel parameter describes the relationship between the two documents, and HREF describes the target document name.

Refer to other articles for cascading style sheets.

ThreeBASE

Base has two main uses:

1, <base href= "original Address" >
The original address of this document. This way, after downloading your document, the reader can also know where to download it.

2, <base target= "Purpose frame Name" >
In a Frame page, if you want to display a frame's connection in another frame, for example, to display the connection in the menu frame to the content frame, you can add <base target= "content" to the page in the menu frame, so , there is no need to add the target attribute to the <a> tag of all connections on the menu page, unless the connection is not displayed in the content framework.

Four, body

The body tag has properties that define the display effect within the page.
ALINK, LINK, TEXT, Vlink

The color of the text.

ALINK: The text color of the currently active connection.
Link: The text color of the connection.
Text: The color of the text.
Vlink: The color of the text that has been visited.

   Attention: The color of the text and the background colors are significantly different, so that the reader to browse.

BACKGROUND, Bgproperties, bgcolor: The background part of the page.

BACKGROUND: Background pattern, which is paved casement the page. The background pattern should be maintained in a single hue to ensure that the page text is easy to read.
Bgproperties: Set to fixed, the background pattern does not scroll. (Valid only for Internet Explorer)
bgcolor: Background color.

   Note:If your background pattern is a dark hue, the text color is a light color, so because the browser calls the page order is "background color-text-background pattern", then the background pattern does not show the case, your text is difficult to read under the white color, so you should choose a background pattern with the color of the back color consistent.

LEFTMARGIN, TOPMARGIN: Margin blank. (Valid only for Internet Explorer)

LEFTMARGIN: Left margin blank.
TOPMARGIN: Top margin blank.
Marginwidth, marginheight: Margin blank. (valid only for Netscape Navigator)
Marginwidth: Left and right margin blank width
Marginheight: Upper and lower margins blank height

Here, for the first time, we ran into the situation where Internet Explorer and Netscape Navigator support different tags. Because of the cruelty of commercial competition, Microsoft and Netscape, the two largest browser software developers, are extending the functionality of HTML to add tags that are not in standard HTML. Because of the confidentiality of trade secrets, two development marks are different. Fortunately, these two browsers for their own unrecognizable tags, will not complain, but simply ignore the past. In this way, we can achieve consistent results by adding all the tags they support. For this example, if we want to make a page, using both browsers, the margin is 0, so you can write:

<body leftmargin= "0" topmargin= "0" marginwidth= "0" marginheight= "0" >

The same can be said of other similar cases, as long as we write them together, there is no problem.



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.