css中的类选择器多关键字的兼容问题
2015-04-08 22:17
267 查看
当我们在使用类选择器的时候,经常会使用多个关键字来给一个元素添加样式。如下所示:
CSS代码:
<span style="font-size:18px;">p.warning.help {background: red;}</span>
HTML代码:
In versions previous to IE7, Internet Explorer for both platforms has problems with correctly handling multiple class selectors. In these older versions, although you can select a single class name out of a list, selecting based
on multiple names in a list does not workproperly.Thus, p.warning would workas expected, but p.warning.help would
match any p elements that have a class attribute with the word help because it comes last in the selector. If you wrote p.help.warning, then older versions of Explorer would match any p elements that have warning in their class value, whether or not help appears
in the same value.
CSS代码:
<span style="font-size:18px;">p.warning.help {background: red;}</span>
HTML代码:
<span style="font-size:18px;"><p class="urgent warning help">Help me!</p></span>
In versions previous to IE7, Internet Explorer for both platforms has problems with correctly handling multiple class selectors. In these older versions, although you can select a single class name out of a list, selecting based
on multiple names in a list does not workproperly.Thus, p.warning would workas expected, but p.warning.help would
match any p elements that have a class attribute with the word help because it comes last in the selector. If you wrote p.help.warning, then older versions of Explorer would match any p elements that have warning in their class value, whether or not help appears
in the same value.
相关文章推荐
- CSS浏览器兼容问题
- IE与Firefox的CSS兼容问题整理
- 最全的CSS浏览器兼容问题
- 网页设计-[ie与firefox的css兼容问题整理!]
- FireFox浏览器和IE浏览器下CSS兼容问题
- Css处理IE和FIREFOX下兼容问题。。。
- IE与Firefox的CSS兼容问题整理
- 最全的CSS浏览器兼容问题整理(IE6.0、IE7.0 与 FireFox)
- IE与Firefox的CSS兼容问题整理
- 十个超级技巧助你解决CSS兼容问题
- div+css - Firefox和IE浏览器兼容问题 - 用CSS实现cellSpacing属性效果
- IE6,IE7,FF | CSS + DIV 兼容问题综合解决方案CSS HACK
- 一些css有关处理浏览器兼容问题上的小技巧
- CSS兼容问题资料汇集
- CSS浏览器兼容问题
- DIV+CSS构建网站时常会出现浏览器不兼容的问题,下面整理了一些常见不兼容问题,及解决办法!
- 标准与兼容--IE与FireFox的CSS闭合兼容问题
- 解决浏览器兼容问题的一个CSS
- IE6、7及火狐不互相兼容CSS的问题
- CSS浏览器兼容问题详解