meta標(biāo)簽到底能干嗎?

mate

標(biāo)簽提供關(guān)于HTML文檔的元數(shù)據(jù)。元數(shù)據(jù)不會(huì)顯示在頁(yè)面上,但是對(duì)于機(jī)器是可讀的。它可用于瀏覽器(如何顯示內(nèi)容或重新加載頁(yè)面),搜索引擎(關(guān)鍵詞)

mate屬性

  • name
    name 屬性提供了名稱/值對(duì)中的名稱。HTML 和 XHTML 標(biāo)簽都沒(méi)有指定任何預(yù)先定義的 <meta> 名稱。通常情況下,您可以自由使用對(duì)自己和源文檔的讀者來(lái)說(shuō)富有意義的名稱。
  • http-equiv
    http-equiv 屬性為名稱/值對(duì)提供了名稱。并指示服務(wù)器在發(fā)送實(shí)際的文檔之前先在要傳送給瀏覽器的 MIME 文檔頭部包含名稱/值對(duì)。
  • content
    content 屬性提供了名稱/值對(duì)中的值(name, http-equiv)。該值可以是任何有效的字符串。
    content 屬性始終要和 name 屬性或 http-equiv 屬性一起使用。

設(shè)定網(wǎng)頁(yè)字符集

<meta http-equiv="content-Type" content="text/html;charset=utf-8">
<meta charset="utf-8">

關(guān)鍵字

<meta name="keywords" content="your,keywords">

響應(yīng)式

<meta name="viewport" content="width=device-width, initial-scale=1">

  • viewport:能優(yōu)化移動(dòng)瀏覽器的顯示。如果不是響應(yīng)式網(wǎng)站,不要使用initial-scale或者禁用縮放。
  • width:寬度(數(shù)值 / device-width)(范圍從200 到10,000,默認(rèn)為980 像素)
  • height:高度(數(shù)值 / device-height)(范圍從223 到10,000)
  • initial-scale:初始的縮放比例 (范圍從>0 到10)
  • minimum-scale:允許用戶縮放到的最小比例
  • maximum-scale:允許用戶縮放到的最大比例
  • user-scalable:用戶是否可以手動(dòng)縮 (no,yes)
  • minimal-ui:可以在頁(yè)面加載時(shí)最小化上下?tīng)顟B(tài)欄。(已棄用)
  • 注意,很多人使用initial-scale=1到非響應(yīng)式網(wǎng)站上,這會(huì)讓網(wǎng)站以100%寬度渲染,
  • 用戶需要手動(dòng)移動(dòng)頁(yè)面或者縮放。如果和initial-scale=1同時(shí)使用user-scalable=no或maximum-scale=1,
  • 則用戶將不能放大/縮小網(wǎng)頁(yè)來(lái)看到全部的內(nèi)容。

移動(dòng)設(shè)備相關(guān)(中國(guó))

  • <meta name="HandheldFriendly" content="true">
  • <meta name="MobileOptimized" content="320">
  • <meta name="screen-orientation" content="portrait">
  • <meta name="x5-orientation" content="portrait">
  • <meta name="full-screen" content="yes">
  • <meta name="x5-fullscreen" content="true">
  • <meta name="browsermode" content="application">
  • <meta name="x5-page-mode" content="app">

Apple ios

  • <meta name="apple-itunes-app" content="app-id=APP_ID,affiliate-data=AFFILIATE_ID,app-argument=SOME_TEXT">
  • <meta name="format-detection" content="telephone=no">
  • <meta name="format-detection" content="email=no">
  • <meta name="apple-mobile-web-app-capable" content="yes">
  • <meta name="apple-mobile-web-app-status-bar-style" content="black">
  • <meta name="apple-mobile-web-app-title" content="App Title">
  • <link rel="apple-touch-icon" href="apple-touch-icon.png">
  • <link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png">

Google android

<meta name="theme-color" content="#E64545">

<meta name="mobile-web-app-capable" content="yes">

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • Spring Cloud為開(kāi)發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見(jiàn)模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,586評(píng)論 19 139
  • 隨著html5的普及和Web技術(shù)的凈化,從Windows XP的IE6到IE8、IE9、IE10、IE11,Edg...
    波段頂?shù)?/span>閱讀 2,422評(píng)論 1 1
  • 其實(shí)這些東西大概在一年前就搞出來(lái)了,看了很多有關(guān)的文章,現(xiàn)在分享出來(lái),如果對(duì)你有些幫助,我還是挺開(kāi)心的。因?yàn)槔锩嬗?..
    其心閱讀 2,848評(píng)論 0 8
  • < meta > 元素概要標(biāo)簽提供關(guān)于HTML文檔的元數(shù)據(jù)。元數(shù)據(jù)不會(huì)顯示在頁(yè)面上,但是對(duì)于機(jī)器是可讀的。它可用于...
    TeslaChen閱讀 1,083評(píng)論 0 1
  • 先附上幾篇網(wǎng)上查找的關(guān)于meta標(biāo)簽的資料、文章,看完這個(gè)幾篇文章后,會(huì)對(duì)meta標(biāo)簽有一定的了解!HTML me...
    米斯特盧閱讀 1,746評(píng)論 0 2

友情鏈接更多精彩內(nèi)容