Home > Web Front-end > HTML Tutorial > meta name='' content='How to use

meta name='' content='How to use

php中世界最好的语言
Release: 2018-02-10 10:18:48
Original
3072 people have browsed it

This time I will bring you how to use meta name="" content=", what are the precautions for using meta name="" content=", what are the precautions, the following is a practical case, let's take a look one time.

1. Grammar:

<meta name="name" content="string"/>
Copy after login

2. Parameter analysis:
a. Name item: Commonly used options include keywords (keywords), description (website content description), author (author), robots (robot guide), etc.
b, http-equiv item: can be used to replace the name item. Commonly used options include Expires (period), Pragma (cache mode), Refresh (refresh), Set-Cookie (cookie setting) , Window-target (setting of display window), content-Type (setting of display character set ), etc.
c, content item: Determine what kind of string to fill in this item based on the definition of the name item or http-equiv item.
3. Application
a. Tell the browser the file type and language type recognized by the web page. For example, if we want the browser to recognize the Simplified Chinese web page of HTM/HTML type, we can write like this:

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

b. Let some search engines search for your web page. The code can be written like this:

<meta name="keywords" content="网页关键字" /> 
<meta name="description" content="网页描述文字" />
Copy after login

To achieve the real convenience of automatic search engines In order to search for your webpage, you must pay attention to the following points:

1. It is necessary to define not only the meta tag item, but also the first 200 characters of the homepage text to reflect the theme of the homepage. Because some

Navigation
platforms not only index the keywords in the meta item, but also index the first 200 characters in the text. Such as: altavista. Therefore, when some people check the registration results after registering the navigation platform, they find that the description in the navigation platform is not what you expected, but text such as a copyright statement. The reason for this phenomenon is that this was not noticed. 2. Place the meta tag item that defines the keyword before the meta item that defines the description. For example:

<meta type="keywords" content=".......,...,..."/> 
<meta type="description" content="...,....,..."/>
Copy after login

3. Put the most important keywords at the front and let related keywords be adjacent. All lowercase and first letter capitalization coexist, because some navigation stations are sensitive to the case of characters when indexing. Do not exceed 250 words including punctuation marks

4. It is best not to use a frame structure on the homepage, because after the frame divides the screen into multiple windows, the navigation station cannot intelligently select the homepage in the correct window for indexing.

c. Let a page pass a certain period of time and automatically go to another page or site, such as:

<meta http-equiv="refresh" content="6; url=http://hi.baidu.com/tesalo/" />
Copy after login

The 6 in the content represents the time, the unit is seconds, url=behind Is the URL you want to redirect to. If it is in the same directory as your current web page, you can directly write the file name, such as:

<meta http-equiv="refresh" content="6; url=page1.htm" />
Copy after login

d. Let the web page be refreshed every once in a while. If you want 10 Refresh once every second. The code is written like this:

<meta http-equiv="refresh" content="10">
Copy after login

e. Through Meta, you can produce some special effects when you enter the page. The specific application is as follows:

<meta http-equiv="Page-Enter" content= "revealTrans(Duration=5.0,Transition=n)" /> 其中,n的取值范围为0-23,具体的意义如下:
Copy after login

3 Circle Expand 4 from bottom to top


I believe you have mastered the methods after reading these cases. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

How to use anchor points in html web pages


What are the ways to hide HtmL elements?

The above is the detailed content of meta name='' content='How to use. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template