如何覆盖Bootstrap的面板标题背景颜色? [英] How to override Bootstrap's Panel heading background color?
问题描述
我使用 Bootstrap
中的面板,但是对于我想使用自己的背景颜色作为标题的标题。当我不为 div
放置 panel-heading
类时,布局被拧了。所以我想我应该保持面板标题
,但后来找到一种方法来覆盖背景颜色。所以我决定创建一个自定义的CSS类,并使用背景颜色
然后将其添加到div与面板的标题
。但是,这并没有使任何影响。
任何想法如何覆盖面板?
代码:
< div class =panel panel-default>
< div class =panel-heading custom_class>
< / div>
< / div>
这应该工作:
.panel> .panel-heading {
background-image:none;
background-color:red;
颜色:白色
}
I'm using a Panel from Bootstrap
however for the heading I want to use my own background color for the heading. When I don't put panel-heading
class for the div
, the layout gets screwed. So I thought I should keep panel-heading
but then find a way to override the background color. So I decided to create a custom css class and use background-color
and then add it to the div with panel-heading
. But this didn't make any effect.
Any idea how to override the heading color of the panel?
Code:
<div class="panel panel-default">
<div class="panel-heading custom_class" >
</div>
</div>
This should work:
.panel > .panel-heading {
background-image: none;
background-color: red;
color: white;
}
这篇关于如何覆盖Bootstrap的面板标题背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!