特定 link rel="STYLESHEET" href="/css/t.cake.css" type="text/css"/link rel="STYLESHEET" href="/css/f.css" type="text/css"/link rel="STYLESHEET" href="/css/t.generic.css" type="text/css"/link rel="STYLESHEET" href="/css/t.head.css" type="t
<link rel="STYLESHEET" href="/css/t.cake.css" type="text/css"/> <link rel="STYLESHEET" href="/css/f.css" type="text/css"/> <link rel="STYLESHEET" href="/css/t.generic.css" type="text/css"/> <link rel="STYLESHEET" href="/css/t.head.css" type="text/css"/>
哪些规则在级联中具有更高的优先级?
假设所有人都有与其他CSS比较相同的优先级?
第一个或最后一个样式表中的那些?
TIA DaveP
根据 the specs,最新的应用.4. Finally, sort by order specified: if two declarations have the same weight, origin and specificity, the latter specified wins. Declarations in imported style sheets are considered to be before any declarations in the style sheet itself.
无论如何,仅仅依靠这一点并不是一种好的做法,因为它会使你的代码难以阅读和解释.我会确保通过选择器的specificity应用了正确的规则,无论它们放在哪个样式表中.