Table of Contents
Meta summary of html
1. Name attribute
A, Keywords (keywords)
B. description (website content description)
C, robots (robot guide)
D、author(author)
E、generator
F. COPYRIGHT
G, revisit-afte
2. http-equiv attribute
A, Expires (period)
B. Pragma (cache mode)
C. Refresh(refresh)
D. Set-Cookie (cookie setting)
E. Window-target (display window setting)
F, content-Type (display character set setting)
G、content-Language(显示语言的设定)
H、http-equiv="imagetoolbar"
J、Content-Script-Type
Home Web Front-end Front-end Q&A What is the role of meta in html

What is the role of meta in html

Nov 17, 2021 pm 04:32 PM
html meta

The role of the meta tag in HTML: 1. Search engine optimization (SEO); 2. Define the encoding used by the page; 3. Automatically refresh and point to the new page; 4. Realize dynamic effects during web page conversion; 5. , control page buffering; 6. web page rating and evaluation; 7. control the window for web page display, etc.

What is the role of meta in html

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

Meta summary of html

The composition of meta tag: meta tag has two attributes, they are http-equiv attribute and name attribute, different attributes are Different parameter values, these different parameter values ​​realize different web page functions.

meta tag has the following functions:

1. Search engine optimization (SEO)

2. Define the encoding used by the page

3. Automatically refresh and point to the new page

4. Achieve dynamic effects during web page conversion

5. Control page buffering

6. Web page rating evaluation

 7. Window that controls web page display

1. Name attribute

The name attribute is mainly used to describe the web page. The corresponding attribute value is content. The content in content is mainly It is convenient for search engine robots to find and classify information.

The syntax format of the name attribute of the meta tag is:

<meta name="参数"content="具体的参数值">。
Copy after login

The name attribute mainly has the following parameters:

A, Keywords (keywords)

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

<meta name="keywords"content="meta总结,html meta,meta属性,meta跳转">
Copy after login

B. description (website content description)

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

<meta name="description"content="haorooms博客,html的meta总结,meta是html语言head区的一个辅助性标签。">
Copy after login

C, robots (robot guide)

Description: robots are used to tell the search robot 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:

<meta name="robots"content="none">
Copy after login

The specific parameters are 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 retrieved, but the links on the page can be queried;

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

D、author(author)

Description: Mark the author of the web page

Example:

<meta name="author"content="root,root@xxxx.com">
Copy after login

E、generator

<meta name="generator"content="信息参数"/>
Copy after login

meta The information parameter of the tag's generator represents the software used to create the website.

<META NAME="COPYRIGHT"CONTENT="信息参数">
Copy after login

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

G, revisit-afte

<META name="revisit-after"CONTENT="7days">
Copy after login

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

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 display it correctly and accurately. Web page content, the corresponding attribute value is content, and the content in content is actually the variable value of each parameter. The syntax format of the http-equiv attribute of the

meta tag is:

; The http-equiv attribute mainly has the following parameters:

A, Expires (period)

Description: It 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:

<meta http-equiv="expires"content="Fri,12Jan200118:18:18GMT">
Copy after login

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:

<meta http-equiv="Pragma"content="no-cache">
Copy after login

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:

<meta http-equiv="Refresh"content="2;URL=http://www.haorooms.com"> //(注意后面的引号,分别在秒数的前面和网址的后面)
Copy after login

Note: The 2 refers to automatically refreshing to the URL after staying for 2 seconds.

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

Usage:

<meta http-equiv="Set-Cookie"content="cookie value=xxx;expires=Friday,12-Jan-200118:18:18GMT;path=/">
Copy after login

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:

<meta http-equiv="Window-target"content="_top">
Copy after login

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:

<meta http-equiv="content-Type"content="text/html;charset=gb2312">
Copy after login

The details are as follows:

  • meta标签的charset的信息参数如GB2312时,代表说明网站是采用的编码是简体中文;

  • meta标签的charset的信息参数如BIG5时,代表说明网站是采用的编码是繁体中文;

  • meta标签的charset的信息参数如iso-2022-jp时,代表说明网站是采用的编码是日文;

  • meta标签的charset的信息参数如ks_c_5601时,代表说明网站是采用的编码是韩文;

  • meta标签的charset的信息参数如ISO-8859-1时,代表说明网站是采用的编码是英文;

  • meta标签的charset的信息参数如UTF-8时,代表世界通用的语言编码;

G、content-Language(显示语言的设定)

用法:

<meta http-equiv="Content-Language"content="zh-cn"/>
Copy after login

H、http-equiv="imagetoolbar"

<meta http-equiv="imagetoolbar"content="false"/>
Copy after login

指定是否显示图片工具栏,当为false代表不显示,当为true代表显示。

J、Content-Script-Type

<Meta http-equiv="Content-Script-Type"Content="text/javascript">
Copy after login

W3C网页规范,指明页面中脚本的类型。

L 页面跳转,只用于IE

推荐教程:《html视频教程

The above is the detailed content of What is the role of meta in html. For more information, please follow other related articles on the PHP Chinese website!

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)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months 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)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles