问题描述
我包括了 first Materialize的CSS,然后然后链接了我的css文件.
I have included first Materialize's CSS and then I have linked my css file.
在其中有一个示例类,该类将background-color
属性设置为red
,但是不会覆盖默认颜色(由materialize-css设置).
In which I have an example class that sets background-color
property to red
, but that doesn't override the default color (that's set by materialize-css).
这是一个例子: https://jsfiddle.net/79ss2eyr/1/
我不想在实现的源文件中进行任何更改,而是希望添加其他类并设置其他颜色.
I'd like not to change anything in materialize's source files, instead I want to add additional classes and set my additional colors.
检查员是这样说的:
我应该怎么做?为什么我的CSS属性不会覆盖实现,因为它是在框架之后链接的?
How should I do that and why my css properties do not override materialize's since it's linked after the framework?
推荐答案
Inn Materialize的规则由footer.page-footer {}
设置,但是您只写了.app-bg
.因此,您不能覆盖物化"规则.
Inn Materialize's the rule is set by footer.page-footer {}
, but you're wrote just .app-bg
. So you can't override the Materialize's rule.
如果您想覆盖该类,则可以使用footer.app-bg
或使用!important
:
If u want to override that class you can use footer.app-bg
or use !important
:
footer.app-bg {
background-color: red;
}
或
.app-bg {
background-color: red !important;
}
这篇关于覆盖Materialize CSS属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!