Change hover color on a button with Bootstrap customization

前端 未结 4 1701
独厮守ぢ
独厮守ぢ 2020-12-24 01:30

I am trying to style my buttons in a way that the hover makes the button a lighter shade instead of a darker shade. I tried bootstrap customization page(http://getbootstrap.

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-24 01:48

    The color for your buttons comes from the btn-x classes (e.g., btn-primary, btn-success), so if you want to manually change the colors by writing your own custom css rules, you'll need to change:

    /*This is modifying the btn-primary colors but you could create your own .btn-something class as well*/
    .btn-primary {
        color: #fff;
        background-color: #0495c9;
        border-color: #357ebd; /*set the color you want here*/
    }
    .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open>.dropdown-toggle.btn-primary {
        color: #fff;
        background-color: #00b3db;
        border-color: #285e8e; /*set the color you want here*/
    }
    

提交回复
热议问题