Coding With Fun
Home Docker Django Node.js Articles FAQ

HTML common meta ingest


May 28, 2021 Article blog



HTML meta metadata is believed to be no stranger to everyone, and this article introduces you to all meta-related information.

Meta: Metadata is data information.

Meta tags act as auxiliary tags in the HTML language that are at Head, between head and title at the head of the HTML, providing information that the user does not display.

Metadata can be called by browsers, search engines, or other Web services.

instance:

<!-- 定义文档的字符编码 -->
<meta charset="utf-8" /> 

<!-- 强制Chromium内核,作用于360浏览器、QQ浏览器等国产双核浏览器 -->
<meta name="renderer" content="webkit"/>

<!-- 强制Chromium内核,作用于其他双核浏览器 -->
<meta name="force-rendering" content="webkit"/>

<!-- 如果有安装 Google Chrome Frame 插件则强制为Chromium内核,否则强制本机支持的最高版本IE内核,作用于IE浏览器 -->
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>

<!-- 
    设置视窗大小
    width    设置layout viewport  的宽度,为一个正整数,或字符串"width-device"
    initial-scale    设置页面的初始缩放值,为一个数字,可以带小数
    minimum-scale    允许用户的最小缩放值,为一个数字,可以带小数
    maximum-scale    允许用户的最大缩放值,为一个数字,可以带小数
    shrink-to-fit=no IOS9中要想前面的属性起作用需要加上这个
    height    设置layout viewport  的高度,这个属性对我们并不重要,很少使用
    user-scalable    是否允许用户进行缩放,值为"no"或"yes", no 代表不允许,yes代表允许
-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

<!-- 页面描述 -->
<meta name="description" content="不超过150个字符"/>

<!-- 页面关键词 -->
<meta name="keywords" content=""/>

<!-- 网页作者 -->
<meta name="author" content="name,[email protected]"/>

<!-- 
    搜索引擎抓取
    all:文件将被检索,且页面上的链接可以被查询; 
    none:文件将不被检索,且页面上的链接不可以被查询;
    index:文件将被检索; 
    follow:页面上的链接可以被查询; 
    noindex:文件将不被检索; 
    nofollow:页面上的链接不可以被查询。 
-->
<meta name="robots" content="index,follow"/>

<!-- 不让百度转码 -->
<meta http-equiv="Cache-Control" content="no-siteapp" />

<!-- uc强制竖屏 -->
<meta name="screen-orientation" content="portrait">

<!-- QQ强制竖屏 -->
<meta name="x5-orientation" content="portrait">

<!-- UC强制全屏 -->
<meta name="full-screen" content="yes">

<!-- QQ强制全屏 -->
<meta name="x5-fullscreen" content="true">

<!-- UC应用模式 -->
<meta name="browsermode" content="application">

<!-- QQ应用模式 -->
<meta name="x5-page-mode" content="app">

<!-- Windows 8 磁贴颜色 -->
<meta name="msapplication-TileColor" content="#000"/>

<!-- Windows 8 磁贴图标 -->
<meta name="msapplication-TileImage" content="icon.png"/>

<!-- 添加 RSS 订阅 -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss.xml"/>
 
<!-- sns 社交标签 begin -->
<!-- 参考微博API -->
<meta property="og:type" content="类型" />
<meta property="og:url" content="URL地址" />
<meta property="og:title" content="标题" />
<meta property="og:image" content="图片" />
<meta property="og:description" content="描述" />
<!-- sns 社交标签 end -->

That's all you need to do with the HTML common meta that's compiled for you.