你现在的位置 -> 云 -> IE !important

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 [...]

分类

随机作品

TWOnet Web Design Beta

清幽淡雅的风格,简洁与干净。

YATAO-2008

YATAO-2008-Web Design

GMC CEO Summit Events Invite Design

GlobalMarket邀请球王来中国的邀请函

UAT9