meta之renderer,metarenderer

來源:互聯網
上載者:User

meta之renderer,metarenderer

今天不小心看了下慕課網首頁的源碼,看到有一行

1 <meta name="renderer" content="webkit|ie-comp|ie-stand">

renderer,這東西不熟,是幹嘛用的?

google之,原來這東西是為雙核瀏覽器準備的:指定雙核瀏覽器預設以何種方式渲染頁面。

<meta name="renderer" content="webkit">//預設webkit核心
<meta name="renderer" content="ie-comp">//預設IE相容模式
<meta name="renderer" content="ie-stand">//預設IE標準模式

而 webkit|ie-comp|ie-stand 這種寫法,跟font-family的規則類似,按照順序排他的優先順序,不支援則往下,瀏覽器將會按照從左至右的先後順序選擇其具備的渲染核心來處理當前網頁。

目前支援對其提供支援的瀏覽器有:360

文章參考:使用meta標籤指定雙核瀏覽器以IE瀏覽器核心渲染網頁

html開啟強製為極速模式,像那樣<meta name="renderer" content="webkit">(加這句都沒用的)

糾結 反正不好用 時靈時不靈的 使用者和產品可沒耐心這樣嘗試
 
怎添加網頁代碼讓所有網站訪問時以相容模式訪問

在head標籤中添加一行代碼:
<html>
<head>
<meta name="renderer" content="webkit|ie-comp|ie-stand">
</head>
<body>
</body>
</html>

content的取值為webkit,ie-comp,ie-stand之一,區分大小寫,分別代表用webkit核心,IE相容核心,IE標準核心。
若頁面需預設用極速核,增加標籤:<meta name="renderer" content="webkit">
若頁面需預設用ie相容核心,增加標籤:<meta name="renderer" content="ie-comp">
若頁面需預設用ie標準核心,增加標籤:<meta name="renderer" content="ie-stand">
 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.