Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change checkbox background color in simple HTML [duplicate]

Tags:

css

I can not change checkbox background color. Any my attempt was unsuccessful, please see - https://jsfiddle.net/o4rnd1q7/1/

    input[type="checkbox"] {
        background-color: #002B4E !important;
        color: white;
    }

    input[type="checkbox"]:enabled:checked {
        background-color: #002B4E !important;
        color: white;
    }

   input[type="checkbox"]:before {
        background-color: #002B4E !important;
        color: white;
    }

    input[type="checkbox"]::before {
        background-color: #002B4E !important;
        color: white;
    }

    .dark-checkbox input[type="checkbox"]:checked {
        background-color: #002B4E !important;
        color: white;
    }

Checkbox still has light blue color instead needed dark blue color.

enter image description here

like image 575
Alex Avatar asked Sep 09 '25 12:09

Alex


1 Answers

You can also do something simple in CSS only for the background color so far as I see. I wish there was a simpler way to do the checkmark, you think that would be considered the font color to it but it is not

input[type="checkbox"] {
accent-color: desired-color
}
like image 124
daddycardona Avatar answered Sep 11 '25 07:09

daddycardona