<p>这些是一些HTML元素中的<meta>标签,用于设置网页的元数据和属性。下面是对每个<meta>标签的详细解释:</p>
<ol>
<li><meta charset='utf-8'>:指定网页的字符编码为UTF-8,以支持显示多种语言和特殊字符。</li>
<li><meta name='wechat-enable-text-zoom-em' content='true'>:用于微信浏览器,允许用户在微信内部对网页进行文字缩放。</li>
<li><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>:与第一个<meta>标签相同的作用,指定网页的字符编码为UTF-8。</li>
<li><meta http-equiv='X-UA-Compatible' content='IE=edge'>:告诉浏览器使用最新的IE版本渲染网页,以确保更好的兼容性。</li>
<li><meta name='color-scheme' content='light dark'>:指定网页的颜色模式,可以是'light'(浅色模式),'dark'(深色模式)或两者都支持。</li>
<li><meta name='viewport' content='width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover'>:设置网页的视口属性,使其在移动设备上正确显示,并禁止用户缩放和滚动。</li>
<li><link rel='shortcut icon' type='image/x-icon' href='//res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico' reportloaderror>:指定网页的图标(favicon),用于显示在浏览器标签页上。</li>
<li><link rel='mask-icon' href='//res.wx.qq.com/a/wx_fed/assets/res/MjliNWVm.svg' color='#4C4C4C' reportloaderror>:指定网页的图标,用于在支持的浏览器中显示在地址栏或书签栏上。</li>
<li><link rel='apple-touch-icon-precomposed' href='//res.wx.qq.com/a/wx_fed/assets/res/OTE0YTAw.png' reportloaderror>:指定网页在iOS设备上添加到主屏幕时显示的图标。</li>
<li><meta name='apple-mobile-web-app-capable' content='yes'>:将网页添加到iOS设备主屏幕后,可以在全屏模式下打开。</li>
<li><meta name='apple-mobile-web-app-status-bar-style' content='black'>:设置网页在iOS设备上添加到主屏幕后的状态栏样式为黑色。</li>
<li><meta name='format-detection' content='telephone=no'>:禁止自动检测网页中的电话号码,防止浏览器将其识别为电话号码并进行链接。</li>
<li><meta name='referrer' content='origin-when-cross-origin'>:设置在跨域请求时,请求头中的referrer属性的值为请求的origin。</li>
<li><meta name='referrer' content='strict-origin-when-cross-origin'>:设置在跨域请求时,请求头中的referrer属性的值为请求的origin,但不包括路径信息。</li>
</ol>
HTML <meta> 标签详解:网页元数据和属性设置

原文地址: https://www.cveoy.top/t/topic/br9D 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录