你现在的位置 -> 云 -> Specificity

CSS权重(优先级)

星期二, 七月 28th, 2009

对于CSS的权重一直以来可以说都是含糊不清的,这个并不是因为大家对其理解有误,而是W3C在CSS2.0的声明来看的确很含糊,但是在CSS2.1里W3C已经对CSS的权重有了明确的规定。 Media type and element match Importance and origin in ascending order of importance (confusingly): user agent style sheets user normal style sheets author normal style sheets author important style sheets user important style sheets Specificity Source order 这里其实一个比较重要的就是“Specificity ” 什么是Specificity? 简单来讲就是一个权重的表达方式:如0,0,0,0。这种表达方法是一种纸牌游戏的表达方法。 更详细的内容请查看这里 所有的权重方法都将依靠他来计算(!important除外)。掌握其特有的特点,将是你对CSS权重理解的一个重要的基石。 我们可以把他简化一下,如下表: 1 * { } 0 2 li { } 1 [...]

分类

随机作品

陈年旧画

Made in YSlove

铅笔素描美女

当时一点点流逝的时候,那些纸上的记忆更加的鲜明!

SCM Web Design

简单的表达出完整的需求,就是好的表达方式。

UAT9