CSS中hack的原理及用法是什么
这篇文章主要讲解了“CSS中hack的原理及用法是什么”,文中的讲解内容简单、清晰、详细,对大家学习或是工作可能会有一定的帮助,希望大家阅读完这篇文章能有所收获。下面就请大家跟着小编的思路一起来学习一下吧。
到此这篇关于“CSS中hack的原理及用法是什么”的文章就介绍到这了,更多相关CSS中hack的原理及用法是什么内容,欢迎关注博信技术资讯频道,小编将为大家输出更多高质量的实用文章!
1、浏览器对CSS样式的支持程度、分析结果和识别CSS的优先级,可以根据这些的特征写出不同的CSS样式代码。
2、IE6可以识别下划线和星号*,IE7可以识别星号*,不能识别下划线_。
firefox两者都不能识别,IE6.IE7和FF可以通过使用这些特殊符号来写出不同的代码。
实例
/*****SelectorHacks******/ /*IE6andbelow*/ *html#uno{color:red} /*IE7*/ *:first-child+html#dos{color:red} /*IE7,FF,Saf,Opera*/ html>body#tres{color:red} /*IE8,FF,Saf,Opera(EverythingbutIE6,7)*/html>/**/body#cuatro{color:red} /*Opera9.27andbelow,safari2*/ html:first-child#cinco{color:red} /*Safari2-3*/ html[xmlns*=""]body:last-child#seis{color:red} /*safari3+,chrome1+,opera9+,ff3.5+*/ body:nth-of-type(1)#siete{color:red} /*safari3+,chrome1+,opera9+,ff3.5+*/ body:first-of-type#ocho{color:red} /*saf3+,chrome1+*/ @mediascreenand(-webkit-min-device-pixel-ratio:0){#diez{color:red}} /*iPhone/mobilewebkit*/ @mediascreenand(max-device-width:480px){ #veintiseis{color:red} } /*Safari2-3.1*/ html[xmlns*=""]:root#trece{color:red} /*Safari2-3.1,Opera9.25*/ *|html[xmlns*=""]#catorce{color:red} /*EverythingbutIE6-8*/ :root*>#quince{color:red} /*IE7*/ *+html#dieciocho{color:red} /*Firefoxonly.1+*/ #veinticuatro,x:-moz-any-link{color:red} /*Firefox3.0+*/ #veinticinco,x:-moz-any-link,x:default{color:red}
本文教程操作环境:windows7系统、css3版,DELL G3电脑。
到此这篇关于“CSS中hack的原理及用法是什么”的文章就介绍到这了,更多相关CSS中hack的原理及用法是什么内容,欢迎关注博信技术资讯频道,小编将为大家输出更多高质量的实用文章!
版权声明
本文仅代表作者观点,不代表博信信息网立场。
上一篇:linux如何查看有哪些服务 下一篇:PHPstorm中PHP运行环境配置怎样做