各种各样的hack。
http://itakeo.com/blog/2015/11/16/allhack/?none=123
Android
Selector Hacks
.selector:not(*:root) {}
- Chrome*
- Safari*
- Opera≥ 14
- Android*
JavaScript Hacks
var isChromium =!!window.chrome;
- Chrome*
- Opera≥ 14
- Android4.0.4
Media Query Hacks
@media screen and (min-width:0\0) {}
- Internet Explorer≥ 9
- Safari4
- Android≥ 2.3
Chrome
Selector Hacks
.selector:not(*:root) {}
- Chrome*
- Safari*
- Opera≥ 14
- Android*
Supports Hacks
@supports (-webkit-appearance:none) {}
- Chrome≥ 28
- Opera≥ 14
Property/Value Hacks
.selector { (;property: value;);}.selector { [;property: value;];}
- Chrome≤ 28
- Safari≤ 7
- Opera≥ 14
JavaScript Hacks
var isChromium =!!window.chrome;
- Chrome*
- Opera≥ 14
- Android4.0.4
var isWebkit ='WebkitAppearance'in document.documentElement.style;
- Chrome*
- Safari≥ 3
- Opera≥ 14
var isChrome =!!window.chrome &&!!window.chrome.webstore;
- Chrome≥ 14
Media Query Hacks
@media \\0 screen {}
- Chrome22-28
- Safari≥ 7
@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {.selector {}}
- Chrome≥ 29
- Opera≥ 16
Firefox
Selector Hacks
body:empty .selector {}
- firefox1.5/2
body:last-child .selector, x:-moz-any-link {}
- firefox≥ 2
body:last-child .selector, x:-moz-any-link, x:default {}
- firefox≥ 3
body:not(:-moz-handler-blocked) .selector {}
- firefox≥ 3.5
_::-moz-progress-bar, body:last-child .selector {}
- firefox≥ 6
_::-moz-range-track, body:last-child .selector {}
- firefox≥ 21
_:-moz-tree-row(hover), .selector {}
- firefox*
_::selection, .selector:not([attr*='']) {}
- Internet Explorer≤ 8
- firefox*
Supports Hacks
@supports (-moz-appearance:meterbar) {}
- firefox≥ 16
@supports (-moz-appearance:meterbar) and (display:flex) {}
- firefox≥ 22
@supports (-moz-appearance:meterbar) and (cursor:zoom-in) {}
- firefox≥ 24
@supports (-moz-appearance:meterbar) and (background-attachment:local) {}
- firefox≥ 25
@supports (-moz-appearance:meterbar) and (image-orientation:90deg) {}
- firefox≥ 26
@supports (-moz-appearance:meterbar) and (all:initial) {}
- firefox≥ 27
@supports (-moz-appearance:meterbar) and (list-style-type:japanese-formal) {}
- firefox≥ 28
@supports (-moz-appearance:meterbar) and (background-blend-mode:difference,normal) {}
- firefox≥ 30
JavaScript Hacks
var isFF =!!window.sidebar;
- firefox*
var isFF ='MozAppearance'in document.documentElement.style;
- firefox*
var isFF =!!navigator.userAgent.match(/firefox/i);
- firefox*
var isFF =typeof InstallTrigger !=='undefined';
- firefox≥ 1.5
var isFF =!!window.globalStorage;
- firefox2-13
var isFF =/a/[-1]=='a';
- firefox2-3
var isFF =(function x(){})[-6]=='x';
- firefox2
var isFF =(function x(){})[-5]=='x';
- firefox3
Media Query Hacks
@media \0 all {}
- firefox≤ 3
@media screen and (-moz-images-in-menus:0) {}
- firefox≥ 3.6
@media screen and (min--moz-device-pixel-ratio:0) {}
- firefox≥ 4
@media all and (min--moz-device-pixel-ratio:0) and (min-resolution: .001dpcm) {}@media all and (-moz-images-in-menus:0) and (min-resolution: .001dpcm) {}
- firefox≥ 8
@media all and (min--moz-device-pixel-ratio:0) {@media (min-width: 0px) {}}@media all and (-moz-images-in-menus:0) {@media (min-width: 0px) {}}
- firefox≥ 11
@media all and (min--moz-device-pixel-ratio:0) and (min-resolution: 3e1dpcm) {}
- firefox≥ 29
Miscellaneous
@-moz-document url-prefix() {}
- firefox≥ 3
Internet Explorer
Selector Hacks
* html .selector {}.unused-class.selector {}
- Internet Explorer≤ 6
html > body .selector {}
- Internet Explorer6
*:first-child+html .selector {}.selector, x:-IE7 {}*+html .selector {}body*.selector {}
- Internet Explorer7
.selector\ {}
- Internet Explorer≤ 7
html >/**/body .selector {}head ~ /**/body .selector {}
- Internet Explorer≤ 7
.selector, {}
- Internet Explorer≤ 7
_::selection, .selector:not([attr*='']) {}
- Internet Explorer≤ 8
- firefox*
:root .selector {}body:last-child .selector {}body:nth-of-type(1) .selector {}body:first-of-type .selector {}.selector:not([attr*='']) {}
- Internet Explorer≤ 8
html[lang='\en'] .selector {}
- Internet Explorer≤ 9
_:-ms-input-placeholder, :root .selector {}
- Internet Explorer≥ 10
_:-ms-fullscreen, :root .selector {}
- Internet Explorer≥ 11
Property/Value Hacks
.selector { _property: value;}.selector {-property: value;}
- Internet Explorer6
.selector {property: value\9;}.selector { property/*\**/: value\9;}
- Internet Explorer6-8
Any combination of these characters: ! $ & * ( ) = % + @ , . / ` [ ] # ~ ? : < > |
.selector { !property: value;}.selector { $property: value;}.selector {&property: value;}.selector { *property: value;}.selector { )property: value;}.selector { =property: value;}.selector { %property: value;}.selector { +property: value;}.selector { @property: value;}.selector { ,property: value;}.selector { .property: value;}.selector { /property: value;}.selector { `property: value;}.selector { ]property: value;}.selector { #property: value;}.selector { ~property: value;}.selector { ?property: value;}.selector {:property: value;}.selector { |property: value;}
- Internet Explorer≤ 7
.selector {property: value !ie;}
- Internet Explorer≤ 7
JavaScript Hacks
查看IE版本
var ieVersion =/*@cc_on (function() {switch(@_jscript_version) {case 1.0: return 3; case 3.0: return 4; case 5.0: return 5; case 5.1: return 5; case 5.5: return 5.5; case 5.6: return 6; case 5.7: return 7; case 5.8: return 8; case 9: return 9; case 10: return 10;}})() || @*/0;
- Internet Explorer3-10
var isIE = document.all &&!window.XMLHttpRequest;
- Internet Explorer≤ 6
var isIE =!!window.ActiveXObject;
- Internet Explorer6-10
var isIE = document.all && document.compatMode;
- Internet Explorer6-10
var isIE = document.all &&!document.querySelector;
- Internet Explorer≤ 7
var isIE = document.all && window.XMLHttpRequest &&!document.querySelector;
- Internet Explorer7
var isIE = document.all && window.XMLHttpRequest;
- Internet Explorer7-10
var isIE = navigator.appVersion.indexOf("MSIE 7.")!==-1;
- Internet Explorer7
var isIE =!+'\v1';
- Internet Explorer≤ 8
var isIE ='\v'=='v';
- Internet Explorer≤ 8
var isIE = document.all && document.querySelector;
- Internet Explorer8-10
var isIE = document.all &&!document.addEventListener;
- Internet Explorer≤ 8
var isIE = document.all && document.querySelector &&!document.addEventListener;
- Internet Explorer8
var isIE = document.all && document.addEventListener;
- Internet Explorer9-10
var isIE = document.all && document.addEventListener &&!window.atob;
- Internet Explorer9
var isIE = document.all &&!window.atob;
- Internet Explorer≤ 9
var isIE =/*@cc_on!@*/false;
- Internet Explorer≤ 10
var isIE = document.all && window.atob;
- Internet Explorer10
查看IE版本
var ieVersion =(function(){if(new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})").exec(navigator.userAgent)!=null){return parseFloat( RegExp.$1);}else{returnfalse;}})();
- Internet Explorer≤ 10
var isIE = eval("/*@cc_on!@*/false")&& document.documentMode ===10;
- Internet Explorer10
var isIE = document.body.style.msTouchAction !== undefined;
- Internet Explorer≥ 10
var isIE = window.navigator.msPointerEnabled;
- Internet Explorer≥ 10
var isIE ='behavior'in document.documentElement.style &&'-ms-user-select'in document.documentElement.style;
- Internet Explorer10
var isIE ='-ms-scroll-limit'in document.documentElement.style &&'-ms-ime-align'in document.documentElement.style;
- Internet Explorer11
Media Query Hacks
@media screen\9 {}
- Internet Explorer≤ 7
@media \0screen\,screen\9 {}
- Internet Explorer≤ 8
@media \0screen {}
- Internet Explorer8
@media screen and (min-width:0\0) {}
- Internet Explorer≥ 9
- Safari4
- Android≥ 2.3
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {}
- Internet Explorer≥ 10
@media screen {@media (min-width: 0px) {}}
- Internet Explorer*
- Safari≤ 6
Conditional comments
<!--[if IE 6]> Internet Explorer 6 <![endif]--><!--[if IE 7]> Internet Explorer 7 <![endif]--><!--[if IE 8]> Internet Explorer 8 <![endif]--><!--[if IE 9]> Internet Explorer 9 <![endif]-->
- Internet Explorer6-9
<!--[if lte IE 6]> Internet Explorer 6 or less <![endif]--><!--[if lte IE 7]> Internet Explorer 7 or less <![endif]--><!--[if lte IE 8]> Internet Explorer 8 or less <![endif]--><!--[if lte IE 9]> Internet Explorer 9 or less <![endif]-->
- Internet Explorer6-9
<!--[if gte IE 6]> Internet Explorer 6 or greater <![endif]--><!--[if gte IE 7]> Internet Explorer 7 or greater <![endif]--><!--[if gte IE 8]> Internet Explorer 8 or greater <![endif]--><!--[if gte IE 9]> Internet Explorer 9 or greater <![endif]-->
- Internet Explorer6-9
<!--[if IE]> Internet Explorer 9- <![endif]-->
- Internet Explorer≤ 9
<!--[if !IE]><!--> Everything but Internet Explorer ≤9 <!--<![endif]-->
- Internet Explorer≤ 9
Opera
Selector Hacks
*|html[xmlns*=""] .selector {}
- Safari2/3.1
- Opera9.25
html:first-child .selector {}
- Opera≤ 9.27
- Safari2
_:-o-prefocus, body:last-child .selector {}
- Opera≥ 9.5
@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) {}
- Opera≤ 11
.selector:not(*:root) {}
- Chrome*
- Safari*
- Opera≥ 14
- Android*
Supports Hacks
@supports (-webkit-appearance:none) {}
- Chrome≥ 28
- Opera≥ 14
Property/Value Hacks
.selector { (;property: value;);}.selector { [;property: value;];}
- Chrome≤ 28
- Safari≤ 7
- Opera≥ 14
JavaScript Hacks
var isOpera =/^function \(/.test([].sort);
- Opera≤ 9.64
var isOpera = window.opera && window.opera.version()== X;
- Opera≤ 12
var isOpera =!!window.opera;
- Opera≤ 12.16
var isChromium =!!window.chrome;
- Chrome*
- Opera≥ 14
- Android4.0.4
var isWebkit ='WebkitAppearance'in document.documentElement.style;
- Chrome*
- Safari≥ 3
- Opera≥ 14
var isOpera =!!window.opera ||/opera|opr/i.test(navigator.userAgent);
- Opera*
Media Query Hacks
@media (min-resolution: .001dpcm) {_:-o-prefocus, .selector {}}
- Opera≥ 12
@media all and (-webkit-min-device-pixel-ratio:0) and (min-resolution: .001dpcm) {.selector {}}
- Chrome≥ 29
- Opera≥ 16
Opera Mini
JavaScript Hacks
div isOperaMini = Object.prototype.toString.call(window.operamini)==='[object OperaMini]';
- Opera Mini*
var isOperaMini =(navigator.userAgent.indexOf('Opera Mini')>-1);
- Opera Mini*
Safari
Selector Hacks
.selector:not(*:root) {}
- Chrome*
- Safari*
- Opera≥ 14
- Android*
html:first-child .selector {}
- Opera≤ 9.27
- Safari2
html[xmlns*=""] body:last-child .selector {}html[xmlns*=""]:root .selector {}
- Safari2-3
*|html[xmlns*=""] .selector {}
- Safari2/3.1
- Opera9.25
_::-moz-svg-foreign-content, :root .selector {}
- Safari5.1-6
Property/Value Hacks
.selector { (;property: value;);}.selector { [;property: value;];}
- Chrome≤ 28
- Safari≤ 7
- Opera≥ 14
JavaScript Hacks
var isWebkit ='WebkitAppearance'in document.documentElement.style;
- Chrome*
- Safari≥ 3
- Opera≥ 14
var isSafari =/a/.__proto__=='//';
- Safari≤ 5
var isSafari =/constructor/i.test(window.HTMLElement);
- Safari*
var isSafari =!!navigator.userAgent.match(/safari/i)&&!navigator.userAgent.match(/chrome/i)&&typeof document.body.style.webkitFilter !=="undefined"&&!window.chrome;
- Safari6
Media Query Hacks
@media screen and (min-width:0\0) {}
- Internet Explorer≥ 9
- Safari4
- Android≥ 2.3
@media screen {@media (min-width: 0px) {}}
- Internet Explorer*
- Safari≤ 6
@media \\0 screen {}
- Chrome22-28
- Safari≥ 7
各种各样的hack。的更多相关文章
- 《Programming WPF》翻译 第7章 1.图形基础
原文:<Programming WPF>翻译 第7章 1.图形基础 WPF使得在你的应用程序中使用图形很容易,以及更容易开发你的显卡的能力.这有很多图形构架的方面来达到这个目标.其中最重要 ...
- CSS中各种各样居中方法的总结
在开发前端页面的时候,元素的居中是一个永远都绕不开的问题.看似简单的居中二字,其实蕴含着许许多多的情况,对应着很多的处理方法,本文就试图对页面布局中的居中问题进行总结~~ 居中问题分为水平居中和竖直居 ...
- 【荐】说说CSS Hack 和向后兼容
人一旦习惯了某些东西就很难去改,以及各种各样的原因,新的浏览器越来越多,而老的总淘汰不了.增长总是快于消亡导致了浏览器兼容是成了谈不完的话题.说 到浏览器兼容,CSS HACK自然而然地被我们想起.今 ...
- Google高级技巧—google Hack★★★★
google hacking事实上并算不上什么新东西,当时并没有重视这样的技术,觉得webshell什么的,并无太大实际用途.google hacking事实上并非如此简单... 经常使用的googl ...
- CSS Hack技术详解,支持IE 6-11、Chrome、FireFox、Safari、Opera 6-11、Chrome、FireFox、Safari、Opera6-11、Chrome、FireFox、Safari、Opera6-11、Chrome、FireFox、Safari、Opera
转自: http://www.365mini.com/page/css-hack-ie-chrome-firefox-safari-opera.htm 当前网络时代,各种各样的网页向我们展示着丰富多彩 ...
- 《Linux内核精髓:精通Linux内核必会的75个绝技》一HACK #6 使用localmodconfig缩短编译时间
HACK #6 使用localmodconfig缩短编译时间 本节介绍使用make localmodconfig生成精简的.config文件,缩短内核编译时间的方法.为了能够应对各种各样的环境,发布版 ...
- google hack使用集锦
转载:https://blog.csdn.net/weixin_42127015/article/details/84472777 关于google hack的几个基础过滤器使用[请务必谨记,过滤器虽 ...
- ie10 css hack 条件注释等兼容方式整理
点评:ie10已经上线一段时间了,相信已经有一部分前端潮人体验过了,截至到现在,在ie6到ie9的浏览器各种各样的古怪行为,开发人员不得不使用条件注释,有条件的类,和其他特定于IE的css hack来 ...
- css常用hack
原文地址:css常用hack 突然想起今天早上在CNZZ看到的统计数据,使用IE6.7的用户比例还真多,看到之后我的心都碎了.微软都放弃了为毛还有这么多人不死心? 所以说,IE下的兼容还是得做的. – ...
随机推荐
- SAP技术相关Tcode
ABAP的常用tcode 开发----------------------------------------------- SE51 屏幕制作 SE91 MESSAGE OBJECT SE80 ...
- android 数据文件存取至储存卡
来自:http://blog.csdn.net/jianghuiquan/article/details/8569233 <?xml version="1.0" encodi ...
- Create a “% Complete” Progress Bar with JS Link in SharePoint 2013
Create a “% Complete” Progress Bar with JS Link in SharePoint 2013 SharePoint 2013 has a lot new fea ...
- 桥牌笔记:Show up Squeeze显露挤牌法
南主打4S,注意一个叫牌过程,西家叫过加倍,东家应叫过2D. 西连打红桃K.A,然后再打红桃J让东家将吃.东家上手后,回小方块.此时庄家已经失了3墩了,如何完成这个4S? 庄家必须拿到所有剩下的牌墩. ...
- 【原】PSD图标素材的全自动切图方法,适用于IOS、安卓、web前端等领域
屌丝个人开发者经常遇到的尴尬问题是,自己不会设计UI素材又请不起专业的美工.最好的方式是去网上下载符合自己需求的素材修修改改直接用上.但是,在这个过程中会发现很多下载下来的素材是PSD格式的,很多图标 ...
- Android中TextView中的文字设置为不同颜色
questionDesTextView=(TextView)findViewById(R.id.question_des); SpannableStringBuilder builder = new ...
- iOS开发笔记6:图片轮播及其无限循环效果
平时APP中的广告位或者滚动的新闻图片等用到的就是图片轮播这种效果,实现方式主要有两种,一种是ScrollView+ImageView,另一种则是通过CollectionView,今天总结的是Scro ...
- jQuery form插件的使用--处理server返回的JSON, XML,HTML数据
详细代码: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> & ...
- 关于统计变换(CT/MCT/RMCT)算法的学习和实现
原文地址http://blog.sina.com.cn/s/blog_684c8d630100turx.html 刚开会每周的例会,最讨厌开会了,不过为了能顺利毕业,只能忍了.闲话不多说了,下面把上周 ...
- Azure 上为Liunx VM 挂载File类型的存储。
1. Create a storage account in Azure, copy the storage account endpoint URL (with postfix of "f ...