对于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 [...]
你现在的位置 -> 云 -> Specificity
CSS权重(优先级)
星期二, 七月 28th, 2009Tags: css, CSS权重, IE !important, Specificity Posted in css, 实验室 | 23 Comments »
分类
最新回复
- Louis Han: 看起来确实很硬
- YSjia: 看了你的博客,是不可以与其他图片延迟...
- Hello Beautiful: 感觉到效果了。。
- Louis Han: 让我想起来一个讽刺的:领导去视察机房...
- YSjia: 我已经看到你了,哈哈!
- junjun: 我要求要被发现
- Y.Jiajia: Hi Marco, Thanks ...
- marco: you can provide th...
- marco: dear YSjia, many u...
- Y.Jiajia: 不行,这种情况应该使用noscrip...
云
.net air Android axure Balsamiq Mockups bing bluehost Chrome css CSS权重 Firefox flash flickr free pictures funny globalmarket Gmail GOMS Google grid GUI gzip htc html4 ICON IE !important ie6 ie7 ipa iPod iTunes javascript jQuery jQuery UI jun lazyload MAC microsoft NDS node.js photoshop php pictures plugins QQ QQMail safar Specificity ssi TWO UE UED UI Warcraft III web 3.0 web design web development weibo widget windows wordpress writer xhtml Yahoo z-index 交互设计 任天堂 前端开发 字体 小故事 工作 影视 思考 恶意软件 情感 手绘 搜索2.0 新浪微博 星际 暴雪 杂谈 正则 流程图 涂鸦 生气 生活 简历 网上购物 艺术 设计 转载 闲聊 面试技巧 鼠绘
