Home Web Front-end HTML Tutorial What are the functions of meta tags?

What are the functions of meta tags?

Feb 03, 2018 am 10:05 AM
meta effect

This time I will show you what the role of meta tags is, and what are the precautions when using meta tags. The following is a practical case, let's take a look.

No matter how wonderful your personal website is, it is as difficult to discover as a small boat in the "vast sea" of cyberspace. How to promote your personal website, the first thing people think of is nothing more than the following: Type:

● Log in to your personal website in the search engine

● Add a link to your personal website on a well-known website

● Post a post in the forum to promote your personal website Website

Many people ignore the powerful effect of HTML tagMETA. A good META tag design can greatly improve the possibility of your personal website being searched. Are you interested? Who Let me re-understand the META tag! The

META tag is an auxiliary tag in the HEAD area of ​​the HTML language. It is located between the HTML documenthead tag and the title << tag. It provides information invisible to the user. . The meta tag is usually used to define the page theme for search engine robots, or to define cookies on the user's browser; it can be used to identify the author, set the page format, mark the content summary and keywords; it can also set the page so that it can be based on You define intervals to refresh yourself, as well as set RASC content levels, etc.

Detailed introduction

The following introduces some examples and explanations of tags.

The META tag is divided into two parts: HTTP header information (HTTP-EQUIV) and page description information (NAME).

★HTTP-EQUIV

HTTP-EQUIV is similar to the header protocol of HTTP. It responds to the browser with some useful information to help display web page content correctly and accurately. Commonly used HTTP-EQUIV types are:

1, Content-Type and Content-Language (display character set settings) transferred from Global Online School edu24ol.com transferred from Global Online School edu24ol.com transferred from Global Online School edu24ol.com

Description: Set the character set used by the page to describe the text and language used to create the homepage. The browser will call the corresponding character set to display the page content based on this.

Usage:

<Meta http-equiv="Content-Type" Content="text/html; Charset=gb2312">
<Meta http-equiv="Content-Language" Content="zh-CN">
Copy after login

Note: The META tag defines the character set used by the HTML page as GB2132, which is the national standard Chinese character code. If "charset=GB2312" is replaced with "BIG5", the character set used on this page is the Traditional Chinese Big5 code. When you browse some foreign sites, IE browser will prompt you that you need to download xx language support to display the page correctly. This function is to know which character set needs to be used to display the page by reading the Content-Type attribute of the META tag of the HTML page. If the corresponding character set is not installed in the system, IE will prompt for downloading. Other languages ​​also correspond to different charsets. For example, the Japanese character set is "iso-2022-jp" and the Korean character set is "ks_c_5601".

Content-Type Content can also be: text/xml and other document types;

Charset options: ISO-8859-1 (English), BIG5, UTF-8, SHIFT-Jis, Euc, Koi8-2, us-ascii, x-mac-roman, iso-8859-2, x-mac-ce, iso-2022-jp, x-sjis, x-euc-jp, euc-kr, iso- 2022-kr, gb2312, gb_2312-80, x-euc-tw, x-cns11643-1, x-cns11643-2 and other character sets; the Content of Content-Language can also be: EN, FR and other language codes.

2. Refresh (Refresh) Transferred from Global Online School edu24ol.com Transferred from Global Online School edu24ol.com Transferred from Global Online School edu24ol.com

Description: How long (seconds) does it take for the web page to refresh itself, or How long after which to allow web pages to automatically link to other web pages.

Usage:

<Meta http-equiv="Refresh" Content="30">
<Meta http-equiv="Refresh" Content="5; Url=http://www.xia8.net">
Copy after login

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

3. Expires (period) Transferred from Global Online School edu24ol.com Transferred from Global Online School edu24ol.com Transferred from Global Online School edu24ol.com

Description: Specify the expiration time of the web page in the cache. Once the web page expires , must be read on the server again.

Usage:

<Meta http-equiv="Expires" Content="0">
<Meta http-equiv="Expires" Content="Wed, 26 Feb 1997 08:21:57 GMT">
Copy after login

Note: You must use the GMT time format, or set it directly to 0 (the number indicates how much time will expire).

4. Pragma (cach mode)

Description: Prohibits the browser from accessing page content from the local machine’s cache.

Usage:

Note: The web page is not saved in the cache, and the page is refreshed every time it is accessed. With this setting, visitors will not be able to browse offline.

5. Set-Cookie (cookie setting)

Description: When the browser visits a certain page, it will be stored in the cache, and it can be read from the cache the next time it is visited again. , to increase speed. Disable caching when you want visitors to refresh your ad's icon every time, or refresh your counter every time. Usually there is no need to disable caching for HTML files. For pages such as ASP, you can disable caching, because every page you see is dynamically generated on the server, and caching is meaningless. If the web page expires, the saved cookies will be deleted.

Usage:

<Meta http-equiv="Set-Cookie" Content="cookievalue=xxx; expires=Wednesday,
21-Oct-98 16:14:21 GMT; path=/">
Copy after login

Note: GMT time format must be used.

6. Window-target (display window setting)

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

用法:

注意:这个属性是用来防止别人在框架里调用你的页面。Content选项:_blank、_top、_self、_parent.

7、Pics-label (网页RSAC等级评定)

说明:在IE的Internet选项中有一项内容设置,可以防止浏览一些受限制的网站,而网站的限制级别就是通过该参数来设置的。

用法::

<META http-equiv="Pics-label" Contect="(PICS-1.1&#39;http://www.rsac.org/ratingsv01.html&#39;I gen comment &#39;RSACi North America Sever&#39; by &#39;inet@microsoft.com&#39;for &#39;http://www.microsoft.com&#39; on &#39;1997.06.30T14:21-0500&#39; r(n0 s0 v0 l0))">
Copy after login

注意:不要将级别设置的太高。RSAC的评估系统提供了一种用来评价Web站点内容的标准。用户可以设置Microsoft Internet Explorer(IE3.0以上)来排除包含有色情和暴力内容的站点。上面这个例子中的HTML取自Microsoft的主页。代码中的(n 0 s 0 v 0 l 0)表示该站点不包含不健康内容。级别的评定是由RSAC,即美国娱乐委员会的评级机构评定的,如果你想进一步了解RSAC评估系统的等级内容,或者你需要评价自己的网站,可以访问RSAC的站点:http://www.rsac.org/.

8、Page-Enter、Page-Exit (进入与退出)

说明:这个是页面被载入和调出时的一些特效。

用法:

<Meta http-equiv="Page-Enter" Content="blendTrans(Duration=0.5)">
<Meta http-equiv="Page-Exit" Content="blendTrans(Duration=0.5)">
Copy after login

二、

name的content指定实际内容。如:如果指定level(等级)为value(值),则Content可能是beginner(初级)、intermediate(中级)、advanced(高级)。

1、Keywords (关键字)

说明:为搜索引擎提供的关键字列表转自环 球 网校edu24ol.com转自环 球 网校edu24ol.com转自环 球 网校edu24ol.com

用法:

注意:各关键词间用英文逗号“,”隔开。META的通常用处是指定搜索引擎用来提高搜索质量的关键词。当数个META元素提供文档语言从属信息时,搜索引擎会使用lang特性来过滤并通过用户的语言优先参照来显示搜索结果。例如:

<Meta name="Kyewords" Content="vacation,greece,sunshine">
<Meta name="Kyewords" Content="vacances,grè:ce,soleil">
Copy after login

2、Description (简介)

说明:Description用来告诉搜索引擎你的网站主要内容。

用法:

注意:

3、Robots (机器人向导)转自环 球 网校edu24ol.com转自环 球 网校edu24ol.com转自环 球 网校edu24ol.com

说明:Robots用来告诉搜索机器人哪些页面需要索引,哪些页面不需要索引。Content的参数有all、none、index、noindex、follow、nofollow。默认是all。

用法:

注意:许多搜索引擎都通过放出robot/spider搜索来登录网站,这些robot/spider就要用到meta元素的一些特性来决定怎样登录。

all:文件将被检索,且页面上的链接可以被查询;

none:文件将不被检索,且页面上的链接不可以被查询;(和 "noindex, no follow" 起相同作用)

index:文件将被检索;(让robot/spider登录)

follow:页面上的链接可以被查询;转自环 球 网校edu24ol.com转自环 球 网校edu24ol.com转自环 球 网校edu24ol.com

noindex:文件将不被检索,但页面上的链接可以被查询;(不让robot/spider登录)

nofollow:文件将不被检索,页面上的链接可以被查询。(不让robot/spider顺着此页的连接往下探找)

4、Author (作者)

说明:标注网页的作者或制作组

用法:

<Meta name="Author" Content="张三,abc@sina.com">
Copy after login

注意:Content可以是:你或你的制作组的名字,或Email

5、Copyright (版权)

说明:标注版权转自环 球 网校edu24ol.com转自环 球 网校edu24ol.com转自环 球 网校edu24ol.com

用法:

<Meta name="Copyright" Content="本页版权归Zerospace所有。All Rights Reserved">
Copy after login

6、Generator (编辑器)

说明:编辑器的说明

用法:

<Meta name="Generator" Content="PCDATA|FrontPage|">
Copy after login

注意:Content="你所用编辑器"

相信看了这些案例你已经掌握了方法,更多精彩请关注php中文网其它相关文章!

相关阅读:

怎样解决textarea标签大小不可变不能通过鼠标拖动的方式来拖动的问题

在HTML中select标签怎样实现单选和多选

a标签的href属性与onclick事件应该如何使用

怎样实现meta标签中的viewport来控制设备屏幕的css属性

The above is the detailed content of What are the functions of meta tags?. 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)
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
4 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)

Analysis of the function and principle of nohup Analysis of the function and principle of nohup Mar 25, 2024 pm 03:24 PM

Analysis of the role and principle of nohup In Unix and Unix-like operating systems, nohup is a commonly used command that is used to run commands in the background. Even if the user exits the current session or closes the terminal window, the command can still continue to be executed. In this article, we will analyze the function and principle of the nohup command in detail. 1. The role of nohup: Running commands in the background: Through the nohup command, we can let long-running commands continue to execute in the background without being affected by the user exiting the terminal session. This needs to be run

New affordable Meta Quest 3S VR headset appears on FCC, suggesting imminent launch New affordable Meta Quest 3S VR headset appears on FCC, suggesting imminent launch Sep 04, 2024 am 06:51 AM

The Meta Connect 2024event is set for September 25 to 26, and in this event, the company is expected to unveil a new affordable virtual reality headset. Rumored to be the Meta Quest 3S, the VR headset has seemingly appeared on FCC listing. This sugge

What is a Bluetooth adapter used for? What is a Bluetooth adapter used for? Feb 19, 2024 pm 05:22 PM

What does a Bluetooth adapter do? With the continuous development of science and technology, wireless communication technology has also been rapidly developed and popularized. Among them, Bluetooth technology, as a short-distance wireless communication technology, is widely used in data transmission and connection between various devices. The Bluetooth adapter plays a vital role as an important device that supports Bluetooth communication. A Bluetooth adapter is a device that can turn a non-Bluetooth device into a device that supports Bluetooth communication. It realizes wireless connection and data transmission between devices by converting wireless signals into Bluetooth signals. Bluetooth adapter

The first open source model to surpass GPT4o level! Llama 3.1 leaked: 405 billion parameters, download links and model cards are available The first open source model to surpass GPT4o level! Llama 3.1 leaked: 405 billion parameters, download links and model cards are available Jul 23, 2024 pm 08:51 PM

Get your GPU ready! Llama3.1 finally appeared, but the source is not Meta official. Today, the leaked news of the new Llama large model went viral on Reddit. In addition to the basic model, it also includes benchmark results of 8B, 70B and the maximum parameter of 405B. The figure below shows the comparison results of each version of Llama3.1 with OpenAIGPT-4o and Llama38B/70B. It can be seen that even the 70B version exceeds GPT-4o on multiple benchmarks. Image source: https://x.com/mattshumer_/status/1815444612414087294 Obviously, version 3.1 of 8B and 70

Six quick ways to experience the newly released Llama 3! Six quick ways to experience the newly released Llama 3! Apr 19, 2024 pm 12:16 PM

Last night Meta released the Llama38B and 70B models. The Llama3 instruction-tuned model is fine-tuned and optimized for dialogue/chat use cases and outperforms many existing open source chat models in common benchmarks. For example, Gemma7B and Mistral7B. The Llama+3 model improves data and scale and reaches new heights. It was trained on more than 15T tokens of data on two custom 24K GPU clusters recently released by Meta. This training dataset is 7 times larger than Llama2 and contains 4 times more code. This brings the capability of the Llama model to the current highest level, which supports text lengths of more than 8K, twice that of Llama2. under

Understand the role and usage of Linux DTS Understand the role and usage of Linux DTS Mar 01, 2024 am 10:42 AM

Understand the role and usage of LinuxDTS In the development of embedded Linux systems, Device Tree (DeviceTree, DTS for short) is a data structure that describes hardware devices and their connection relationships and attributes in the system. The device tree enables the Linux kernel to run flexibly on different hardware platforms without modifying the kernel. In this article, the function and usage of LinuxDTS will be introduced, and specific code examples will be provided to help readers better understand. 1. The role of device tree device tree

Explore the importance and role of define function in PHP Explore the importance and role of define function in PHP Mar 19, 2024 pm 12:12 PM

The importance and role of the define function in PHP 1. Basic introduction to the define function In PHP, the define function is a key function used to define constants. Constants will not change their values ​​during the running of the program. Constants defined using the define function can be accessed throughout the script and are global. 2. The syntax of define function The basic syntax of define function is as follows: define(&quot;constant name&quot;,&quot;constant value&amp;qu

Llama3 comes suddenly! The open source community is boiling again: the era of free access to GPT4-level models has arrived Llama3 comes suddenly! The open source community is boiling again: the era of free access to GPT4-level models has arrived Apr 19, 2024 pm 12:43 PM

Llama3 is here! Just now, Meta’s official website was updated and the official announced Llama 38 billion and 70 billion parameter versions. And it is an open source SOTA after its launch: Meta official data shows that the Llama38B and 70B versions surpass all opponents in their respective parameter scales. The 8B model outperforms Gemma7B and Mistral7BInstruct on many benchmarks such as MMLU, GPQA, and HumanEval. The 70B model has surpassed the popular closed-source fried chicken Claude3Sonnet, and has gone back and forth with Google's GeminiPro1.5. As soon as the Huggingface link came out, the open source community became excited again. The sharp-eyed blind students also discovered immediately

See all articles