twitter-bootstrap 添加 panel-heading:hover class in bootstrap less 不会改变悬停颜色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20453624/
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
Adding panel-heading:hover class in bootstrap less does not change the hover color
提问by Patryk
I have added the following lines to bootstrap/less/panels.less
我添加了以下几行 bootstrap/less/panels.less
//hover color for panel heading
.panel-heading:hover {
background-color: #dfdfdf;
}
But it wouldn't load to the css in the browser. yet I can manually add it in the css editor (in chrome dev tools) and it works.
但它不会加载到浏览器中的 css。但是我可以在 css 编辑器中手动添加它(在 chrome 开发工具中)并且它可以工作。
Any solutions ?
任何解决方案?
回答by n1kkou
If it works in chrome dev tools and in css file not, that means it is overwritten from other rule. You can overwrite the rule by increasing the specificity (e.g. concatenate another class name or some other selector), or, to be sure, use "!important":
如果它适用于 chrome 开发工具而不适用于 css 文件,则意味着它会被其他规则覆盖。您可以通过增加特殊性来覆盖规则(例如连接另一个类名或其他一些选择器),或者,可以肯定的是,使用“!重要”:
.panel-heading:hover {
background-color: #dfdfdf !important;
}

