Home Web Front-end HTML Tutorial Introduction to the use of the http-equiv attribute in the meta tag_HTML/Xhtml_Web page production

Introduction to the use of the http-equiv attribute in the meta tag_HTML/Xhtml_Web page production

May 16, 2016 pm 04:40 PM
meta tag

meta is an auxiliary tag in the head area of ​​html language. Maybe you think this code is dispensable. In fact, if you can make good use of meta tags, it will bring you unexpected effects. The functions of meta tags are: search engine optimization (SEO), defining the language used on the page, automatically refreshing and pointing to new pages, and realizing dynamics during web page conversion. Effect, control page buffering, web page rating and evaluation, control the window for web page display, etc.!

Composition of meta tag: The meta tag has two attributes, they are http-equiv attribute and name attribute. Different attributes have different parameter values. These different parameter values Different web page functions are implemented.

1. Name attribute

The name attribute is mainly used to describe web pages, and the corresponding attribute value is content. The content in content is mainly used by search engine robots to find information and classify information. . The syntax format of the name attribute of the

meta tag is:

.

The name attribute mainly has the following parameters:

A. Keywords (keywords)

Explanation: keywords are used to tell search engines what the keywords of your web page are. .

Example:

B. description (website content description)

Explanation: description is used to tell search engines the main content of your website.

Example:

C. robots (robot guide)

Explanation: robots are used to tell search robots which pages need to be indexed and which pages do not need to be indexed.

The parameters of content include all, none, index, noindex, follow, and nofollow. The default is all.

Example:

D. author (author)

Explanation: Mark the author of the web page

Example:

2. http-equiv attribute

http-equiv, as the name suggests, is equivalent to the file header function of http. It can return some useful information to the browser to help correct and accurate The content of the web page is displayed accurately, and the corresponding attribute value is content. The content in content is actually the variable value of each parameter. The http-equiv attribute syntax format of

meta tag is:

;

The http-equiv attribute mainly has the following parameters:

A. Expires

Description: Can be used to set the expiration time of the web page. Once a web page expires, it must be retransmitted to the server.

Usage:

Note: GMT time format must be used.

B. Pragma (cache mode)

Description: Prohibit the browser from accessing page content from the cache of the local computer.

Usage:

Note: With this setting, visitors will not be able to browse offline.

C. Refresh (refresh)

Description: Automatically refresh and point to the new page.

Usage: (note the quotation marks at the end, respectively before the seconds and after the URL)

Note: The 2 means that it will automatically refresh to the URL after staying for 2 seconds. URL.

D. Set-Cookie (cookie setting)

Note: If the web page expires, the saved cookies will be deleted.

Usage:

Note: GMT time format must be used.

E. Window-target (display window setting)

Description: Force the page to be displayed as an independent page in the current window.

Usage:

Note: Used to prevent others from calling your own page in the frame.

F, content-Type (display character set setting)

Description: Set the character set used by the page.

Usage:

G, content-Language (display language setting)

Usage:

H, Cache- Control specifies the caching mechanism that requests and responses follow.
Cache-Control specifies the caching mechanism that requests and responses follow. Setting Cache-Control in a request message or response message does not modify the caching process during the processing of another message. The caching instructions during the request include no-cache, no-store, max-age, max-stale, min-fresh, on

ly-if-cached, and the instructions in the response message include public, private, no -cache, no-store, no-transform, must-revalidate, proxy-revalidate, max-age. The meaning of the instructions in each message is as follows
Public indicates that the response can be cached by any cache
Private indicates that all or part of the response message for a single user cannot be processed by the shared cache. This allows the server to only describe a partial response message from a user that is not valid for other users' requests
no-cache indicates that the request or response message cannot be cached
no-store is used to prevent important information from being inadvertently released . Sending it in the request message will cause both the request and response messages to use caching.
max-age indicates that the client can receive responses with a lifetime no greater than the specified time in seconds
min-fresh indicates that the client can receive responses with a response time less than the current time plus the specified time
max-stale indicates that the client can receive response messages beyond the timeout period. If you specify a value for max-stale messages, the client can receive response messages that exceed the specified value of the timeout period.

Meta tag usage tips:

Meta tag is a language used to describe the properties of web pages. Standard Meta tags can facilitate search engine ranking and improve search engine websites. Weight ranking. If you want your website to be more in line with search engine standards, you must understand meta tags. Below, Seoer will explain the meaning and usage of meta tags:

1. Keywords of META tags

The writing method is:

The information parameter of the Keywords of the meat tag represents the keywords of the website.

2. Description of the META tag



The information parameter of the Description of the meta tag represents the main content and overview of the website.

3. The http-equiv=Content-Typecontent="text/html of the META tag

http-equiv=Content-Type represents the HTTP header protocol and prompts the browser for the web page Information,



When the information parameter of the charset of the meta tag is such as GB2312, it means that the encoding used by the website is Simplified Chinese;

The charset of the meta tag When the information parameter is like BIG5, it means that the encoding used by the website is Traditional Chinese; When the information parameter of the charset of the

meta tag is like iso-2022-jp, it means that the encoding used by the website is Japanese;

When the charset information parameter of the meta tag is such as ks_c_5601, it means that the encoding used by the website is Korean;

When the charset information parameter of the meta tag is such as ISO-8859-1, it means that the website is The encoding used is English;

When the information parameter of the charset of the meta tag is UTF-8, it represents the world's universal language encoding;

4. The generator of the META tag



The information parameters of the generator of the meta tag represent the software used to create the website.

5. The author of the META tag



The author information parameter of the meta tag represents the copyright author information of the web page

6. http-equiv="Refresh" of the META tag



The Refresh of the meta tag represents how long it takes for the web page to automatically refresh. Adding the URL parameters in Url means how long it takes to automatically link to other URLs.

7. HTTP-EQUIV="Pragma"CONTENT of the META tag. ="no-cache"

means that the browser is prohibited from accessing page content from the cache of the local computer. With this setting, visitors will not be able to browse offline.

8. META. COPYRIGHT of the tag



The COPYRIGHT information parameter of the meta tag represents the website copyright information.

9. http-equiv="imagetoolbar" of the META tag.



Specify whether to display the image toolbar. When false, it means not to display, when true, it means to display.

10. Content-Script- of the META tag. Type



W3C web page specification, indicating the type of script in the page.

11. META tag revisit-after



revisit-after represents website revisit, 7days represents 7 days, and so on.

12. Robots of META tags

Robots representatives tell search engine robots which pages to crawl

The attributes are described as follows :

The information parameter is all: the file will be retrieved, and the links on the page can be queried;

The information parameter is none: the file will not be retrieved, and the links on the page cannot be queried. ;

The information parameter is index: the file will be retrieved;

The information parameter is follow: the links on the page can be queried;

The information parameter is noindex: the file will not be be retrieved, but the links on the page can be queried;

information parameter is nofollow: the file will be retrieved, but the links on the page cannot be queried;

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What are the best practices for cross-browser compatibility in HTML5? What are the best practices for cross-browser compatibility in HTML5? Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

How do I use HTML5 form validation attributes to validate user input? How do I use HTML5 form validation attributes to validate user input? Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

How do I use the HTML5 <time> element to represent dates and times semantically? How do I use the HTML5 <time> element to represent dates and times semantically? Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 &lt;time&gt; element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

What is the viewport meta tag? Why is it important for responsive design? What is the viewport meta tag? Why is it important for responsive design? Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

The article discusses the &lt;iframe&gt; tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

See all articles