成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

史上最全的瀏覽器CSS&JS Hack手冊

開發 前端
瀏覽器渲染頁面的方式各不相同,甚至同一瀏覽器的不同版本(“杰出代表”是 IE)也有差異。因此,瀏覽器兼容成為前端開發人員的必備技能。如果有一份瀏覽器 Hack 手冊,那查詢起來就方便多了。

瀏覽器渲染頁面的方式各不相同,甚至同一瀏覽器的不同版本(“杰出代表”是 IE)也有差異。因此,瀏覽器兼容成為前端開發人員的必備技能。如果有一份瀏覽器 Hack 手冊,那查詢起來就方便多了。這篇文章就向大家分享 Browserhacks 幫我們從網絡上收集的各個瀏覽器特定的 CSS & JavaScript Hack,記得推薦和分享啊!

IE 選擇器 Hack

  1. /* IE 6 and below */ 
  2. * html .selector  {}    
  3. .suckyie6.selector {} /* .suckyie6 can be any unused class */ 
  1. /* IE 7 and below */ 
  2. .selector, {} 
  1. /* IE 7 */ 
  2. *:first-child+html .selector {}    
  3. .selector, x:-IE7 {}    
  4. *+html .selector {} 
  1. /* Everything but IE 6 */ 
  2. html > body .selector {} 
  1. /* Everything but IE 6/7 */ 
  2. html > /**/ body .selector {}   
  3. head ~ /* */ body .selector {} 
  1. /* Everything but IE 6/7/8 */ 
  2. :root *> .selector {}    
  3. body:last-child .selector {}    
  4. body:nth-of-type(1) .selector {}    
  5. body:first-of-type .selector {} 

IE 屬性/值 Hack

  1. /* IE 6 */ 
  2. .selector { _colorblue; }    
  3. .selector { -colorblue; } 
  1. /* IE 6/7 - acts as an !important */ 
  2. .selector { colorblue !ie; }    
  3. /* string after ! can be anything */ 
  1. /* IE 6/7 - any combination of these characters:    
  2.  ! $ & * ( ) = % + @ , . / ` [ ] # ~ ? : < > | */ 
  3. .selector { !colorblue; }    
  4. .selector { $colorblue; }    
  5. .selector { &colorblue; }    
  6. .selector { *colorblue; }    
  7. /* ... */ 
  1. /* IE 8/9 */ 
  2. .selector { color: blue\0/; }    
  3. /* must go at the END of all rules */ 
  1. /* IE 9/10 */ 
  2. .selector:nth-of-type(1n) { colorblue\9; } 
  1. /* IE 6/7/8/9/10 */ 
  2. .selector { color: blue\9; }    
  3. .selector { color/*\**/: blue\9; } 
  1. /* Everything but IE 6 */ 
  2. .selector { color/**/: blue; } 

IE Media Query Hack

  1. /* IE 6/7 */ 
  2. @media screen\9 {} 
  1. /* IE 8 */ 
  2. @media \0screen {} 
  1. /* IE 9/10, Firefox 3.5+, Opera */ 
  2. @media screen and (min-resolution: +72dpi) {} 
  1. /* IE 10+ */ 
  2. @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {} 
  1. /* IE 6/7/8 */ 
  2. @media \0screen\,screen\9 {} 
  1. /* IE 8/9/10 & Opera */ 
  2. @media screen\0 {} 
  1. /* IE 9/10 */ 
  2. @media screen and (min-width:0\0) {} 
  1. /* Everything but IE 6/7/8 */ 
  2. @media screen and (min-width: 400px) {} 

IE JavaScript Hack

  1. /* IE 6 */ 
  2. (checkIE = document.createElement("b")).innerHTML = "<!--[if IE 6]><i></i><![endif]-->";    
  3. var isIE = checkIE.getElementsByTagName("i").length == 1; 
  1. /* IE 7 */ 
  2. (checkIE = document.createElement("b")).innerHTML = "<!--[if IE 7]><i></i><![endif]-->";    
  3. var isIE = checkIE.getElementsByTagName("i").length == 1;   
  4. navigator.appVersion.indexOf("MSIE 7.")!=-1 
  1. /* IE <= 8 */ 
  2. var isIE = '\v'=='v'
  1. /* IE 8 */ 
  2. (checkIE = document.createElement("b")).innerHTML = "<!--[if IE 8]><i></i><![endif]-->";    
  3. var isIE = checkIE.getElementsByTagName("i").length == 1; 
  1. /* IE 9 */ 
  2. (checkIE = document.createElement("b")).innerHTML = "<!--[if IE 9]><i></i><![endif]-->";    
  3. var isIE = checkIE.getElementsByTagName("i").length == 1; 
  1. /* IE 10 */ 
  2. var isIE = eval("/*@cc_on!@*/false") && document.documentMode === 10; 
  1. /* IE 10 */ 
  2. var isIE = document.body.style.msTouchAction != undefined; 

Firefox 瀏覽器

選擇器 Hack

  1. /* Firefox 1.5 */ 
  2. body:empty .selector {} 
  1. /* Firefox 2+ */ 
  2. .selector, x:-moz-any-link {} 
  1. /* Firefox 3+ */ 
  2. .selector, x:-moz-any-link; x:default {} 
  1. /* Firefox 3.5+ */ 
  2. body:not(:-moz-handler-blocked) .selector {} 

媒體查詢 Hack

  1. /* Firefox 3.5+, IE 9/10, Opera */ 
  2. @media screen and (min-resolution: +72dpi) {} 
  1. /* Firefox 3.6+ */ 
  2. @media screen and (-moz-images-in-menus:0) {} 
  1. /* Firefox 4+ */ 
  2. @media screen and (min--moz-device-pixel-ratio:0) {} 

JavaScript Hack

  1. /* Firefox */ 
  2. var isFF = !!navigator.userAgent.match(/firefox/i); 
  1. /* Firefox 2 - 13 */ 
  2. var isFF = Boolean(window.globalStorage); 
  1. /* Firefox 2/3 */ 
  2. var isFF = /a/[-1]=='a'
  1. /* Firefox 3 */ 
  2. var isFF = (function x(){})[-5]=='x'

Chrome 瀏覽器

選擇器 Hack

  1. /* Chrome 24- and Safari 5- */ 
  2. ::made-up-pseudo-element, .selector {} 

媒體查詢 Hack

  1. /* Chrome, Safari 3+ */ 
  2. @media screen and (-webkit-min-device-pixel-ratio:0) {} 

JavaScript Hack

  1. /* Chrome */ 
  2. var isChrome = Boolean(window.chrome); 

Safari 瀏覽器

選擇器 Hack

  1. /* Safari 2/3 */ 
  2. html[xmlns*=""] body:last-child .selector {}    
  3. html[xmlns*=""]:root .selector  {} 
  1. /* Safari 2/3.1, Opera 9.25 */ 
  2. *|html[xmlns*=""] .selector {} 
  1. /* Safari 5- and Chrome 24- */ 
  2. ::made-up-pseudo-element, .selector {} 

媒體查詢 Hack

  1. /* Safari 3+, Chrome */ 
  2. @media screen and (-webkit-min-device-pixel-ratio:0) {} 

JavaScript Hack

  1. /* Safari */ 
  2. var isSafari = /a/.__proto__=='//'

Opera 瀏覽器

選擇器 Hack  

  1. /* Opera 9.25, Safari 2/3.1 */ 
  2. *|html[xmlns*=""] .selector {} 
  1. /* Opera 9.27 and below, Safari 2 */ 
  2. html:first-child .selector {} 
  1. /* Opera 9.5+ */ 
  2. noindex:-o-prefocus, .selector {} 

媒體查詢 Hack

  1. /* Opera 7 */ 
  2. @media all and (min-width: 0px){} 
  1. /* Opera 12- */ 
  2. @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) {} 
  1. /* Opera, Firefox 3.5+, IE 9/10 */ 
  2. @media screen and (min-resolution: +72dpi) {} 
  1. /* Opera, IE 8/9/10 */ 
  2. @media screen {} 

JavaScript Hack

  1. /* Opera 9.64- */ 
  2. var isOpera = /^function \(/.test([].sort); 
  1. /* Opera 12- */ 
  2. var isOpera = Boolean(window.opera); 

在線查詢          在線測試

原文鏈接:http://www.cnblogs.com/lhb25/archive/2013/03/11/browser-css-js-hacks-browserhacks.html

責任編輯:張偉 來源: 博客園
相關推薦

2010-09-15 15:39:03

CSS hack

2010-09-15 16:19:17

IECSS hack

2015-06-12 11:26:02

CSS瀏覽器 CSS Hac

2010-09-16 13:48:15

CSS Hack

2010-09-15 16:29:20

CSS hackIE8

2010-08-30 15:40:31

CSS瀏覽器兼容

2011-04-02 14:52:52

2011-04-02 14:49:27

2010-09-15 16:48:51

IE8CSS hack

2011-07-01 10:20:32

2010-08-19 15:47:34

CSS Reset瀏覽器

2009-12-31 15:58:11

Silverlight

2010-08-20 14:11:26

IE火狐瀏覽器

2010-06-23 13:24:00

CSSCSS選擇器

2010-09-14 14:18:09

CSS跨瀏覽器開發

2013-11-20 13:04:41

css瀏覽器渲染

2010-04-05 21:57:14

Netscape瀏覽器

2014-12-19 12:57:57

APP推廣運營

2022-07-07 08:43:05

HoudiniAPICSS

2018-09-18 11:20:07

css html5javascript
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 亚洲三区视频 | 在线中文一区 | 亚洲欧美国产毛片在线 | 手机在线不卡av | 亚洲欧美中文字幕在线观看 | 久久久久久综合 | 91久久精品日日躁夜夜躁欧美 | 日韩视频免费看 | 免费在线观看一区二区 | 日韩成人免费av | 三级视频在线观看 | 国产美女自拍视频 | 97伦理影院| 久久亚洲一区二区 | 亚洲激情在线 | 亚洲三级在线观看 | 亚洲精品电影在线观看 | 91亚洲精选 | 日日干干 | 欧美6一10sex性hd | 亚洲成人av | 波多野结衣精品 | 九九九视频精品 | 国产在线精品一区二区三区 | 国产在线aa| 天堂免费看片 | 日韩欧美国产一区二区 | 国产成人自拍一区 | 欧美日韩一本 | 久草青青草| 国产黄色在线观看 | 欧美精品一区在线观看 | 精品日韩在线观看 | 成年人在线观看 | 成人在线亚洲 | 91精品国产综合久久国产大片 | 羞羞的视频在线观看 | 亚洲不卡在线观看 | 99热在这里只有精品 | 久久婷婷色 | 九九热久久免费视频 |