meta 标签由 name 和 content 属性定义, 用来描述网页文档的属性, 比如网页的作者, 网页描述, 关键词等, 除了 HTTP 标准固定了一些 name 作为大家使用的共识, 开发者还可以自定义 name。
<meta charset="UTF-8">
<meta name="keywords" content="关键词"/>
<meta name="description" content="页面描述内容"/>
<meta http-equiv="refresh" content="0;url="/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
content 参数:
width viewport: 宽度(数值/device-width)height viewport: 高度(数值/device-height)initial-scale: 初始缩放比例maximum-scale: 最大缩放比例minimum-scale: 最小缩放比例user-scalable: 是否允许用户缩放(yes/no)<meta name="robots" content="index,follow"/>
content 参数:
all: 文件将被检索, 且页面上的链接可以被查询none: 文件将不被检索, 且页面上的链接不可以被查询index: 文件将被检索follow: 页面上的链接可以被查询noindex: 文件将不被检索nofollow: 页面上的链接不可以被查询