[英]Specific which external CSS files overrides which
I'm working on a web project that uses SOY templates and SASS. 我正在使用SOY模板和SASS的Web项目上工作。 For reasons, I'm not able to get SASS preprocessor to continue working it with SASS but all the CSS and SCSS files are present and I can look at them just not modify.
由于某些原因,我无法让SASS预处理器继续与SASS一起使用,但是所有CSS和SCSS文件都存在,并且我可以不修改地查看它们。
I currently have a custom CSS file that I'm working on, however some things are getting override by the CSS file the SASS created. 我目前正在使用一个自定义CSS文件,但是有些东西被SASS创建的CSS文件覆盖。 For example,
!important
and generally just making it harder to add my own CSS when some things are getting override. 例如,
!important
通常会使某些事情被覆盖时,增加我自己的CSS的难度。
So my question is, is there a way to specific which CSS file gets called last so that one can overrides all the previous CSS? 所以我的问题是,有没有一种方法可以确定最后调用哪个CSS文件,以便可以覆盖以前的所有CSS?
I'd suggest you put your CSS file after other CSS files. 我建议您将CSS文件放在其他CSS文件之后。 And furthermore, you need to read about the precedence rule: https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
而且,您需要阅读有关优先级规则的信息: https : //developer.mozilla.org/en-US/docs/Web/CSS/Specificity
.parent > .child .element{ color: #000}
and then you can copy that CSS selector and use it in your css file to avoid !important
.parent > .child .element{ color: #000}
另一个更强的规则,例如.parent > .child .element{ color: #000}
,然后您可以复制该CSS选择器并在CSS中使用它避免使用文件!important
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.