元数据名称
name 和 content 属性可以一起使用,以名 - 值对的方式给文档提供元数据,其中 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 | 要求机器人不跟随此页面上的链接。 | 所有爬虫 |
all | 与 index, follow 等价 | |
none | 与 noindex, nofollow 等价 | |
noarchive | 要求搜索引擎不缓存页面内容。 | Google、Yahoo、Bing |
nosnippet | 不在搜索引擎的结果中显示该网页的任何描述。 | Google、Bing |
noimageindex | Requests this page not to appear as the referring page of an indexed image. | |
nocache | noarchive 的替代名称。 | Bing |
