大佬教程收集整理的这篇文章主要介绍了如何为Mozilla,Chrome和IE编写特定的CSS,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
为了那个原因
然后根据检测到的浏览器创建动态CSS文件
/***** SELEctor Hacks ******/
/* ie6 and below */
* HTML #uno { color: red }
/* ie7 */
*:first-child+HTML #dos { color: red }
/* ie7, FF, Saf, Opera */
HTML>body #tres { color: red }
/* ie8, FF, Saf, Opera (Everything but IE 6,7) */
HTML>/**/body #cuatro { color: red }
/* Opera 9.27 and below, safari 2 */
HTML:first-child #cinco { color: red }
/* Safari 2-3 */
HTML[xmlns*=""] body:last-child #seis { color: red }
/* safari 3+, Chrome 1+, opera9+, ff 3.5+ */
body:nth-of-type(1) #sIEte { color: red }
/* safari 3+, Chrome 1+, opera9+, ff 3.5+ */
body:first-of-type #ocho { color: red }
/* saf3+, Chrome1+ */
@media screen and (-webkit-min-device-pixel-ratio:0) {
#dIEz { color: red }
}
/* iPhone / mobile webkit */
@media screen and (max-device-wIDth: 480pX) {
#veintiseis { color: red }
}
/* Safari 2 - 3.1 */
HTML[xmlns*=""]:root #trece { color: red }
/* Safari 2 - 3.1, Opera 9.25 */
*|HTML[xmlns*=""] #catorce { color: red }
/* Everything but ie6-8 */
:root *> #quince { color: red }
/* ie7 */
*+HTML #dIEciocho { color: red }
/* firefox only. 1+ */
#veinticuatro, x:-moz-any-link { color: red }
/* firefox 3.0+ */
#veinticinco, x:-moz-any-link, x:default { color: red }
/***** Attribute Hacks ******/
/* ie6 */
#once { _color: blue }
/* ie6, ie7 */
#doce { *color: blue; /* or #color: blue */ }
/* Everything but ie6 */
#dIEcisIEte { color/**/: blue }
/* ie6, ie7, ie8 */
#dIEcinueve { color: blue\9; }
/* ie7, ie8 */
#veinte { color/*\**/: blue\9; }
/* ie6, ie7 -- acts as an !important */
#veintesIEte { color: blue !IE; } /* String after ! can be anything */
以上是大佬教程为你收集整理的如何为Mozilla,Chrome和IE编写特定的CSS全部内容,希望文章能够帮你解决如何为Mozilla,Chrome和IE编写特定的CSS所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。