Bootstrap4 radio button background and fill color

前端 未结 2 550
野的像风
野的像风 2020-12-24 14:33

I was wondering how can I change Bootstraps radio button background color and fill color?

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-24 15:23

    Use the custom-radio class like so:

    
    
    

    That gives you the flexibility to style the radio input in any way you want.

    The background color (i.e. what you see in the default, unchecked state) is controlled by this rule:

    .custom-control-label::before {
        background-color: darkorange;
    }

    I changed it from the default grey to orange there.

    And here are the css rules to control all states:

    
    
    
    
    

提交回复
热议问题