html - 定义相同类的两个 CSS 文件 - 跨浏览器行为?

标签 html css

<分区>

Possible Duplicate:
Two css files defining same class

this question 的答案和 this question声明当在两个不同的 CSS 文件中指定相同的选择器/属性组合时,最后包含的文件中的那个将获胜。我的问题是,这种行为是标准(HTML 或 CSS)的一部分,还是仅仅是主要浏览器中的当前行为?我需要知道我是否可以在所有浏览器中依赖此行为。如果这是标准的一部分,请引用相关部分好吗?

最佳答案

Finally, sort by order specified: if two declarations have the same weight, origin and specificity, the latter specified wins.

http://www.w3.org/TR/CSS21/cascade.html#cascading-order

如果它们在同一个文件中,同样适用。

关于html - 定义相同类的两个 CSS 文件 - 跨浏览器行为?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9791205/

上一篇:html - Div 中的表格 Firefox 与 Chrome

下一篇:css - 文字阴影不显示

相关文章:

javascript - 页脚中的一个 <A> 元素不响应悬停或点击

css - Webkit 忽略溢出 :hidden when background is animated with @keyframes

javascript - <div> 获取自动宽度,无需在 html 中进行初始化

java - 想要在 HTML 表单字段中捕获 'Enter' 按键

css - 如何将文本推到左侧(开箱即用)并使其隐藏?

jquery - 更改按钮文本 jquery 移动

html - 居中对齐多个淡入淡出图像

html - 背景对 Bootstrap 没有响应

html - 尝试对齐 <p> 两边的图像

javascript - JQuery - 嵌套循环问题