【发布时间】:2018-08-29 09:20:06
【问题描述】:
我在一个 HTML 元素上有两个 CSS 类:.c-headline-1 和 .c-hero__headline。在我的外部样式表中,我使用.c-headline-1,在内部样式表(<style type="text/css">)中我使用.hero__headline,但由于某种原因,.c-headline-1 属性值覆盖了.hero__headline 的一些属性价值观。例如,如果两者都有字体大小声明,.c-headline-1 的行为就好像它具有更高的特异性,因为它覆盖了.c-hero__headline 的字体大小。
我认为内部样式表比外部样式表具有更高的特异性,还是没有?
【问题讨论】:
标签: css css-specificity