<meta>The main function is to provide meta information of the web page. For example: specify the search keywords of the web page.
The<meta> tag has two attributes: http-equiv and name.
http-equiv attribute
Function: simulate http protocol file header information, when the information comes from the server When passed to the client, it tells the browser how to display the web page content correctly.
The http-equiv attribute is generally used in conjunction with the content attribute. The Content attribute specifies the detailed parameters of the information.
(1) Set the character set of the web page
<meta http-equiv="Content-Type" content="text/html ; charset=utf-8" />
We have come across this many times in the previous examples
(2) Automatically refresh the web page
<meta http-equiv="refresh" content="2"> //Automatically refresh the web page every 2 seconds
<meta http-equiv="refresh" content= "2;url=http://www.baidu.com"> //After 2 seconds, jump to Baidu
to see an example
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="refresh" content="2;url=http://www.baidu.com"> </head> <body> <h1>欢迎加入php.cn</h1> <h2>希望你能够在这里学的开心</h2> </body> </html>
name attribute
The name attribute is mainly used to set the search keywords, copyright information, author, etc. of the web page .
Look at the search results of a website
(1) The first part is to set the web search keywords
<meta name= "keywords" content="小 pigcms, pigcms, WeChat public platform source code, WeChat distribution, WeChat development, WeChat o2o source code..." />
(2) The second part is to set the web page description information
<meta name="description" content="Xiaozhucms is a national high-tech enterprise, a dual-software certified enterprise, and a senior WeChat development expert , providing WeChat marketing system, o2o system, WeChat distribution, WeChat application account source code program, company customers all over the world”>
Next Section