How to override Bootstrap's Panel heading background color?

后端 未结 11 1524
情书的邮戳
情书的邮戳 2021-01-31 08:08

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

11条回答
  •  眼角桃花
    2021-01-31 08:33

    How about creating your own Custom Panel class? That way you won't have to worry about overriding Bootstrap.

    HTML

    Panel title

    Panel content

    CSS

    .panel-custom-horrible-red {
        border-color: #ff0000;
    }
    .panel-custom-horrible-red > .panel-heading {
        background: #ff0000; 
        color: #ffffff;
        border-color: #ff0000;
    }
    

    Fiddle: https://jsfiddle.net/x05f4crg/1/

提交回复
热议问题