CSS 将 !important 应用于具有多个选项的字体系列
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10524324/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Apply !important to font-family with more than one option
提问by rauland
How can I apply !important to the following syle:
我如何将 !important 应用于以下 syle:
font-family: "Trebuchet MS" , Verdana, Helvetica, Sans-Serif;
I've tried this, but doesn't work:
我试过这个,但不起作用:
font-family: "Trebuchet MS" , Verdana, Helvetica, Sans-Serif !important;
采纳答案by Yisela
The code is fine. It would vary depending on which elements you are giving the property to. It's better if you use specific selectors such as classes:
代码没问题。它会根据您将属性提供给哪些元素而有所不同。最好使用特定的选择器,例如类:
回答by daleyjem
Select the children within the parent container with a wildcard (*):
使用通配符 (*) 选择父容器中的子项:
div * {font-family: "Trebuchet MS" , Verdana, Helvetica, Sans-Serif !important; }