meta

<!-- 設置文檔的字符編碼 -->
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- 以上 3 個 meta 標籤 *必須* 放在 head 的最前面;其餘任何的 head 內容必須在這些標籤的 *後面* -->
 
<!-- 對外部資源加載的限制(容許控制從哪裏加載資源) -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
<!-- 儘早地放置在文檔中 -->
<!-- 僅應用於該標籤下的內容 -->
 
<!-- Web 應用的名稱(僅當網站被用做爲一個應用時才使用)-->
<meta name="application-name" content="應用名稱">
 
<!-- 針對頁面的簡短描述(限制 150 字符)-->
<!-- 在*某些*狀況下,該描述是被用做搜索結果展現片斷的一部分 -->
<meta name="description" content="一個頁面描述">
 
<!-- 控制搜索引擎的抓取和索引行爲 -->
<meta name="robots" content="index,follow"><!-- 全部搜索引擎 -->
<meta name="googlebot" content="index,follow"><!-- 僅對 Google 有效 -->
 
<!-- 告訴 Google 不顯示網站連接的搜索框 -->
<meta name="google" content="nositelinkssearchbox">
 
<!-- 告訴 Google 不提供此頁面的翻譯 -->
<meta name="google" content="notranslate">
 
<!-- 驗證 Google 搜索控制檯的全部權 -->
<meta name="google-site-verification" content="verification_token">
 
<!-- 驗證 Yandex 網站管理員的全部權 -->
<meta name="yandex-verification" content="verification_token">
 
<!-- 驗證 Bing 網站管理員中心的全部權 -->
<meta name="msvalidate.01" content="verification_token">
 
<!-- 驗證 Alexa 控制檯的全部權 -->
<meta name="alexaVerifyID" content="verification_token">
 
<!-- 驗證 Pinterest 控制檯的全部權 -->
<meta name="p:domain_verify" content="code from pinterest">
 
<!-- 驗證 Norton 安全站點的全部權 -->
<meta name="norton-safeweb-site-verification" content="norton code">
 
<!-- 用來命名軟件或用於構建網頁(如 - WordPress、Dreamweaver)-->
<meta name="generator" content="program">
 
<!-- 關於你的網站主題的簡短描述 -->
<meta name="subject" content="你的網站主題">
 
<!-- 基於網站內容給出通常的年齡分級 -->
<meta name="rating" content="General">
 
<!-- 容許控制 referrer 信息如何傳遞 -->
<meta name="referrer" content="no-referrer">
 
<!-- 禁用自動檢測和格式化可能的電話號碼 -->
<meta name="format-detection" content="telephone=no">
 
<!-- 經過設置爲 「off」 徹底退出 DNS 預取 -->
<meta http-equiv="x-dns-prefetch-control" content="off">
 
<!-- 在客戶端存儲 cookie,web 瀏覽器的客戶端識別 -->
<meta http-equiv="set-cookie" content="name=value; expires=date; path=url">
 
<!-- 指定要顯示在一個特定框架中的頁面 -->
<meta http-equiv="Window-Target" content="_value">
 
<!-- 地理標籤 -->
<meta name="ICBM" content="latitude, longitude">
<meta name="geo.position" content="latitude;longitude">
<meta name="geo.region" content="country[-state]"><!-- 國家代碼 (ISO 3166-1): 強制性, 州代碼 (ISO 3166-2): 可選; 如 content="US" / content="US-NY" -->
<meta name="geo.placename" content="city/town"><!-- 如 content="New York City" -->

網站圖標

<!-- 針對 IE 10 及如下版本 -->
<!-- 若是將 `favicon.ico` 放在根目錄下,則無需標籤 -->
 
<!-- 對於 IE 十一、Chrome、Firefox、Safari 和 Opera -->
<link rel="icon" type="image/png" sizes="16x16" href="/path/to/favicon-16x16.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="/path/to/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="96x96" href="/path/to/favicon-96x96.png"/>
<!-- 更多信息: https://bitsofco.de/all-about-favicons-and-touch-icons/ -->

 

一行代碼解決各類IE兼容問題,IE6,IE7,IE8,IE9,IE10javascript

2012-04-25 16:29:04| 分類: 學習 |字號 訂閱
在網站開發中難免由於各類兼容問題苦惱,針對兼容問題,其實IE給出瞭解決方案Google也給出瞭解決方案html

百度也應用了這種方案去解決IE的兼容問題html5

百度源代碼以下java

<!Doctype html>
<html xmlns=http://www.w3.org/1999/xhtml xmlns:bd=http://www.baidu.com/2010/xbdml>
<head>
<meta http-equiv=Content-Type content=「text/html;charset=utf-8″>
<meta http-equiv=X-UA-Compatible content=IE=EmulateIE7>
<title>百度一下,你就知道 </title>
<script>var wpo={start:new Date*1,pid:109,page:‘superpage’}</script>
<meta http-equiv=X-UA-Compatible content=IE=EmulateIE7>git

能夠打開百度,右鍵查看源碼看下!咱們能夠看下文件頭是否存在這樣一行代碼!web

這句話的意思是強制使用IE7模式來解析網頁代碼!chrome

在這裏送上幾種IE使用模式!瀏覽器

<meta http-equiv=「X-UA-Compatible」 content=「IE=8″>
2. Google Chrome Frame也可讓IE用上Chrome的引擎:安全

<meta http-equiv=「X-UA-Compatible」 content=「chrome=1″ />
3.強制IE8使用IE7模式來解析服務器

<meta http-equiv=「X-UA-Compatible」 content=「IE=EmulateIE7″><!– IE7 mode –>
//或者
<meta http-equiv=「X-UA-Compatible」 content=「IE=7″><!– IE7 mode –>
4.強制IE8使用IE6或IE5模式來解析

<meta http-equiv=「X-UA-Compatible」 content=「IE=6″><!– IE6 mode –> 

<meta http-equiv=「X-UA-Compatible」 content=「IE=5″><!– IE5 mode –> 
5.若是一個特定版本的IE支持所要求的兼容性模式多於一種,如:

<meta http-equiv=「X-UA-Compatible」 content=「IE=5; IE=8″ />
二.設定網站服務器以指定預設兼容性模式

若是服務器是本身的話,能夠在服務器上定義一個自訂標頭來爲它們的網站預設一個特定的文件兼容性模式。這個特定的方法取決於你的網站服務器。

錄入,下列的 web.config文件使Microsoft Internet Information Services (IIS)能定義一個自訂標頭以自動使用IE7 mode來編譯全部網頁。

另外還有一塊兒其餘的解決方案,例如google的

ie7 – js中是一個JavaScript庫(解決IE與W3C標準的衝突的JS庫),使微軟的Internet Explorer的行爲像一個Web標準兼容的瀏覽器,支持更多的W3C標準,支持CSS二、CSS3選擇器。它修復了許多的HTML和CSS問題,並使 得透明PNG在IE五、IE6下正確顯示。

使IE5,IE6兼容到IE7模式(推薦)

<!–[if lt IE 7]>
<script src=」http://ie7-js.googlecode.com/svn/version/2.0(beta)/IE7.js」 type=」text/javascript」></script>
<![endif]–>
使IE5,IE6,IE7兼容到IE8模式

<!–[if lt IE 8]>
<script src=」http://ie7-js.googlecode.com/svn/version/2.0(beta)/IE8.js」 type=」text/javascript」></script>
<![endif]–>
使IE5,IE6,IE7,IE8兼容到IE9模式

<!–[if lt IE 9]>
<script src=」http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js」></script>
<![endif]–>
解決PNG顯示問題

只需將透明png圖片命名爲*-trans.png

須要注意的是:此方法對背景平鋪(background-repeat)和背景(background-position)沒法起到任何做用,默認會佔滿整個容器。

轉載:http://hi.baidu.com/myplan/blog/item/cdb09dfa1fa748a99f514626.html

3、<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />建立html5時發現這麼一句話,不知其什麼意思,百度以下:這樣寫能夠達到的效果是若是安裝了GCF,則使用GCF來渲染頁面,若是沒安裝GCF,則使用最高版本的IE內核進行渲染。Google Chrome Frame(谷歌內嵌瀏覽器框架GCF)。這個插件可讓用戶的IE瀏覽器外不變,但用戶在瀏覽網頁時,實際上使用的是Google Chrome瀏覽器內核,並且支持IE六、七、8等多個版本的IE瀏覽器。http://blog.csdn.net/abxn2002/article/details/7312459

相關文章
相關標籤/搜索