Skip to content

元数据名称

namecontent 属性可以一起使用,以名 - 值对的方式给文档提供元数据,其中 name 作为元数据的名称,content 作为元数据的值。

viewport

为视口的初始大小提供指示。目前仅用于移动设备。

html
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
参数作用
width=device-width视口等于设备宽度
initial-scale=1.0初始缩放
maximum-scale最大缩放
user-scalable=no禁止缩放(慎用)

description

  • 搜索引擎结果页的摘要内容

  • 不直接影响排名,但影响点击率

html
<meta name="description" content="这是一个前端学习网站" />

keywords

与页面内容相关的关键词。

警告

现代搜索引擎几乎不再使用?

html
<meta name="keywords" content="HTML,CSS,JavaScript" />

robots

爬虫、协作搜寻器,或者“机器人”,对此页面的处理行为,或者说,应当遵守的规则。是一个使用逗号分隔的、由下列值构成的列表:

描述被用于
index允许机器人索引此页面(默认)。所有爬虫
noindex要求机器人不索引此页面。所有爬虫
follow允许机器人跟随此页面上的链接(默认)。所有爬虫
nofollow要求机器人不跟随此页面上的链接。所有爬虫
allindex, follow 等价Google
nonenoindex, nofollow 等价Google
noarchive要求搜索引擎不缓存页面内容。GoogleYahooBing
nosnippet不在搜索引擎的结果中显示该网页的任何描述。GoogleBing
noimageindexRequests this page not to appear as the referring page of an indexed image.Google
nocachenoarchive 的替代名称。Bing