网站开发经常需要对页面做一些处理,比如 SEO、控制页面显示方式等等,下面做下整理方便查阅。
Meta
网页编码
<meta charset="UTF-8">
网页自适应
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
以最新内核加载
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<meta name="renderer" content="webkit">
Chrome 沉浸颜色
<meta name="theme-color" content="#颜色" />
DNS 预加载
<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="dns-prefetch" href="//链接" />
禁止识别电话号邮箱
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
Windows8 磁贴
<meta name="msapplication-TileColor" content="#颜色"/>
<meta name="msapplication-TileImage" content="链接"/>
描述
可被 QQ 分享抓取版:
<meta name="description" itemprop="description" content="喵喵喵">
关键词
<meta name="keywords" content="英文逗号分割每个关键词,就像这样">
禁止浏览器读取缓存
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
<meta http-equiv="expires" content="0">
QQ 分享
<meta itemprop="name" content="分享标题"/>
<meta itemprop="image" content="分享缩略图" />
页面跳转
<meta http-equiv="refresh" content="3;url=https://vircloud.net/">
允许记录访问来源
<meta name="referrer" content="always">
Link
网页图标
<link rel="icon" type="image/ico" href="favico.ico">
页面样式表
<link rel="stylesheet" href="https://vircloud.net/usr/themes/armx/css/style.css">
Safari 图标
<link rel="apple-touch-icon" href="https://vircloud.net/usr/themes/armx/img/apple-touch-icon.png">
定义网页语言
<link rel="alternate" href="https://vircloud.net/" hreflang="zh-Hans" />
声明源网页
即多个网页内容相同的话,告诉搜索引擎应该抓哪个地址为准。
<link rel="canonical" href="https://vircloud.net/" />