HTML meta tag

 HTML meta tags can be used to provide web page content information to browsers or search engines. For example, web page content description, web page important keywords, web page coding, etc. are commonly used meta-marked web page information, in addition to web page authors, web pages Less important information such as the release time and the editor used can also be marked with META TAG. The function of META is only used to indicate the information of these web pages, and it is provided to the browser or search engine, not for writing Content for "people" who browse the web.


HTML meta tag is written in the head example
<head>
<title>Test page</title>
<meta name="description" content="here is a short description of the page">
<meta name="keywords" content="keyword1,keyword2">
< /head>
The standard <meta> tag has no end. Just write the parameters directly in the <meta>. There can be many different <meta> tags in a web page, all of which must be written in the head tag. The title tag in the example is Used to mark the title of the web page, it can be written before the <meta> tag or after the <meta> tag.

The function of the traditional HTML meta tag has two important parts, namely name and http-equiv. With the update of HTML, the latest HTML5 has begun to support the syntax of charset. The following three parts are made into Table for your reference.

HTML meta name common attributes
grammarDescription
<meta name="description" content="Short description of the page">Used to write a short description of the web page.
<meta name="keywords" content="Webpage keywords">Used to place webpage keywords.
<meta name="author" content="author name">
Record the name of the author of the webpage
<meta name="generator" content="editor name">
Used to record the name of the web editor
<meta name="copyright" content="page copyright">
Used to indicate the copyright or copyright notice of the webpage
<meta name="distribution" content="web publishing area">
Used to record the publishing area of ​​the webpage

The most commonly used meta tags are actually only the first two, namely name=descript and name=keywords. When each meta uses name, it will be used with content to present the information content. In short, name represents the information item, and content represents Information value.

HTML meta http-equiv common attributes
grammarDescription
<meta http-equiv="Content-Type" content="text/html"; charset="uft-8">
Types and encoding of web content
<meta http-equiv="Content-Language" content="zh-TW">
The language of the webpage
<meta http-equiv="Refresh" content="time">
Automatically update the time of the page
<meta http-equiv="Pragma" content="no-cache">
Prevent browsers from opening web pages with cache
<meta http-equiv="windows-Target" content="_top">
Force to display web pages in a single window

For examples, please refer to: HTML meta http-equiv attribute

HTML 5 new meta function
grammarDescription
<meta charset="UTF-8">
Set the web page encoding, UTF-8 is the universal code

HTML5 can be said to be an evolutionary version of HTML webpages. It only needs to be written in such a short way to mark the encoding of webpages. With the popularity of UTF-8 universal code, it is recommended that designers try their best to design webpages. Mainly UTF-8. After all, browsers of different versions in many countries are less prone to errors.

Post a Comment

0 Comments