HTML meta tag


The <meta> tag is used to provide meta-information about the page, such as the encoding language used by the page or keywords and descriptions for the search engine.

The <meta> tag is inside the <head> tag, which is an unpaired tag and is closed with />.

<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

This example tell the browser: to prepare to receive the file as html files, and use the UTF-8 encoding

<meta> tag attribute

Attributes Value Description
http-equiv content-type
content-language
expires
refresh
set-cookie
pragma
Associating the content attribute to the HTTP header helps the browser display the page content correctly and accurately.
name author
description
keywords
generator
revised
others
Joint content is used to describe web pages, in order to facilitate search engine robots to find, classification
content Specific content description, combined with other labels used together

The http-equiv attribute

The http-equiv attribute instructs the server to send the MIME information to the browser before sending the actual document. For HTML documents, at least one content-type: text / html message is sent, which tells the browser to accept an HTML document. Http-equiv Attribute Value Explanation:

Attribute Value Description
content-type Sets the MIME type of the page, including the character set used.
content-language Sets the language of the page content.
expires Period, specify the page cache period expires must be re-go to the server to obtain.
refresh Set the page to automatically refresh or automatically connect to the target site at the specified time (seconds).
set-cookie Sends cookie information to a page
pragma Web pages are not stored in the cache, each visit will refresh the page, visitors will not be able to browse offline.

The name attribute

The joint content attribute is used to describe the Web page, so that the search engine robot can find and classify it. Name Attribute Value Description:

Attribute Value Description
robots Robot Wizard, corresponding to content = "all" that allows all the robot behavior.
keywords A list of keywords for search engines. Note: each keyword in English commas, separated. The number of keywords to keep the best in less than 5, the key words and page content related.
description Used to tell the search engine your site or the main content of the page, description and page content to be related to the number of words in less than 150 words is appropriate.
copyright Mark page copyright information.
author E-mail the page author or company and contact.
generator Describe the Web page editor.
revisit-after Used to guide the search engine to re-visit your site's time interval, the time unit in general use days.

Name attribute is not the necessary content of the page, the actual application can be selected according to the specific circumstances of the value of the property needs to help explain the page.

In addition to the above agreed value of the property, but also according to the actual situation from the definition of a meaningful name attribute value, such as document creation date (creationdate).


The content property

The content attribute provides the specific content for the description, which needs to be used in conjunction with the http-equiv or name attribute.




Copyright 2014-2017 by DeveloperTut.com. All Rights Reserved.
TwitterGoogle+Facebook