Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Active class CSS in Bootstrap

I am using AngularJS and Bootsrtrap in my code. I am using this library for pagination for tables in it. It says here that I can style it with bootstrap, and I wanted to change color of selected number to orange.

enter image description here

Class of that field is active in CSS, and I tried to override its style in my css, but nothing changed. I used this CSS:

.active {
    background-color: #FFC773;
}

Can anyone help me solve this?

like image 466
Dejan Avatar asked Aug 09 '26 21:08

Dejan


1 Answers

Above given answers are absolutely correct but you should also define the CSS for other states like focus, active and hover:

.pagination > .active > a, .pagination > .active > a:focus, .pagination > .active > a:hover, .pagination > .active > span, .pagination > .active > span:focus, .pagination > .active > span:hover {
    background-color: orange;
    border-color: organge;
}

This is to avoid various other issues.

like image 150
Shashank Agrawal Avatar answered Aug 11 '26 12:08

Shashank Agrawal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!