Understanding of meta tags

First, what is meta tags

meta tag provides metadata about the HTML document (Metadata is information about data), the metadata is not displayed on the page, but for a machine readable. For example meta is used to set a keyword, set the page description, setting author, character set, set the page timed jump and so on. meta tags placed in the head tag, a set of meta-search engine registration, search engine optimization has a crucial role in rankings.

Two, meta tags role

meta data is available in the machine interpretation, tells the machine how to parse this page, there is a purpose that can be added to the server sends the browser http header content

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"> //声明字符编码
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
</body>
</html>

Three, meta tags common use


<!-- 声明文档使用的字符编码 -->
<meta charset='utf-8'>
<!--百度禁止转码-->
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!-- 页面描述 -->
<meta name="description" content="不超过150个字符"/>
<!-- 页面关键词 keywords -->
<meta name="keywords" content="your keywords">
<!-- 禁止自动翻译 -->
<meta name="renderer" content="webkit">
<!-- 较重要的是viewport属性。常用于移动端设计。 -->
<meta name="viewport" content="width=device-width, initial-scale=1">
content 参数:
width viewport 宽度(数值/device-width)
height viewport 高度(数值/device-height)
initial-scale 初始缩放比例
maximum-scale 最大缩放比例
minimum-scale 最小缩放比例
user-scalable 是否允许用户缩放(yes/no)
Published 23 original articles · won praise 0 · Views 207

Guess you like

Origin blog.csdn.net/CCT912097957/article/details/105255999