CSS hacks take advantage of browser bugs for hiding CssRules from specific web browsers. Listed below are the hacks for major browsers like ie6, ie7, firefox2, firefox3, Google chrome, safari and opera.
Inline Hack for IE
* (star) can be used as the inline hack for both ie6 and ie7.
For Example:
Syntax: .selector{*property:value;}
.logo{*margin-left:10px;}
IE6 browser inline Hack
_ (underscore) can be using only for ie6
For Example:
Syntax: .selector{_property:value;}
.logo{_margin-left:10px;}
Firefox inline style
content:"\"/*" can be used for firefox only where IE cannot recognize it.
Internal Style
Use * html for ie6 and *+html hack for ie7
For Example:
Synatax: * html .selector{property:value;} , * + html .selector{property:value;}
* html .logo{margin-left:10px;} for ie6
* + html .logo{margin-left:20px;} for ie7
IE7 and Firefox browser Hack
Use html>body hack for ie7 and firefox.
For Example:
Syntax: html>body .selector{property:value;}
html>body .logo{margin-left:10px} will take only in ie7 and firefox
Mordern browser Hack or Firefox Hack
Use html>/**/body {} hack which will support only in both firefox2 and firefox3.
For Example:
Syntax: html>/**/body .selector{property:value;}
html>/**/body .logo{margin-left:10px} will take only in firefox.
Browser hack for Opera versions 9 and below
Use html:first-child {} for opera browser. Also you use
Syntax: @media all and (min-width:0px) {head~body .selector {property:value;}}
For Example:
@media all and (min-width:0px) {head~body .logo {margin-left:10px;}} only for opera
Firefox3 browser hack
Use html>/**/body .selector, x:-moz-any-link, x:default {property:value;} for firfox3 only.
For Example:
Syntax: html>/**/body .pro_yl, x:-moz-any-link, x:default {background:red;}
Google Chrome browser hack
Use body:nth-of-type(1) .elementOrClassName{property:value;} only for google chrome.
For Example:
body:nth-of-type(1) .logo{margin:20px;}
@media screen and (-webkit-min-device-pixel-ratio:0)
{ #div { properties:value; } }
Safari browser hack
Use Syntax: body:first-of-type .elementOrClassName{property:value;}
Fox Example:
body:first-of-type .logo{margin-top:10px;} only for safari.
Hope this information will be useful for you. Please use the browser hacks in a proper manner. For example, you might know double margin bug in ie6. In such case you can use display inline which will render correctly by all the browsers instead of you using ie6 hack seperately.
分享到:
相关推荐
browser-hack-sass-mixins:浏览器hack sass mixin-将SCSS应用于特定的浏览器-CSS hacks:IE,Chrome,Firefox,Edge,Opera
Vim-101-hacks、Sed-and-Awk-101-Hacks、Linux-101-hacks 英文版(高清)PDF
Wireless Hacks: 100 Industrial-Strength Tips & Tools英文版
Google Hacks - 100 Industrial-Strenght Tips & Tools - O'Reilly - 2003 Google hacks code.rar
Wireless Hacks 100 Industrial-Strength Tips and Tools
python库。 资源全名:free-cash-app-money-hacks-no-offers-2022-v-6907.zip
资源来自pypi官网。 资源全名:Coin-Master-Hacks-Spin-Generator-2021-2.0.2.tar.gz
书是Miracle Linux的创始人吉冈弘隆和几位工程师们多年从事内核开发的经验积累。从调试器的基本使用方法、汇编的基础知识开始,到内核错误信息捕捉、应用程序调试、内核调试,本书深入浅出地讲解了Linux下应用程序和...
免积分下载。
Knight Hacks CSS研讨会对于研讨会,我们将使用starter目录中的代码。 在您最喜欢HTML / CSS IDE(建议使用Visual Studio Code)中打开此文件,然后在浏览器(建议使用Chrome)中打开index.html 。 最终产品位于...
all css hacks 列表 支持目前主流游览器
复制代码代码如下: .test{ color:/*\**/#00f\9; /* IE8 */ } .test, .test:-moz-any-link{...可同时区分IE8、IE7、IE6、Firefox的CSS hacks: CSS代码 复制代码代码如下: .test{ color:#000; /* Firefox */ color:/*\
利用这些CSS Hacks,你能够更好的针对IE、Chrome、Firefox、Opera和Safari,代码如下: 浏览器特定的CSS Hacks综合列表: 复制代码代码如下:/***** Selector Hacks ******//* IE6 and below */* ...
linuxserverhacks2-13.pdf
Summer_Connector_Final 与您附近的人联系,享受夏季活动!...(MLH淘汰了hacks out项目)----------------这是Summer Connecter的令人敬畏的版本该项目主要用于flask,socketio,python,javascript,postgresql数据库
Linux-101-Hacks,Linux-101-Hacks
The CSS code used to create each of the components is available for download and guaranteed to be simple, efficient and cross-browser compatible. This book will show you how to: Construct robust CSS...
took the world by storm in the 1990s as a one-of-a-kind, searchable list of interesting web sites. But ten years later, it has expanded into a department store overflowing with useful and innovative ...
征服–前往壳牌 Vanquish是一个使用Python构建的基于Kali Linux的枚举协调器。 Vanquish利用Kali上的开源枚举工具来执行多个活动信息收集阶段。 每个阶段的结果都将进入下一个阶段,以识别可用于远程Shell的漏洞。...