Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Background-color on checkbox doesn't set the color

I have an <input type="checkbox" />

I’ve managed to set things like the border color, but I seem not to be able to set the background-color. It just stays white.

Can anybody offer a solution, I’ve been looking on this site and others for an answer, but none that I’ve found work. This is an internal app that will be using the Edge Browser.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It might be overriden by your browser’s default settings. Have you tried adding !important to the background-color option?

If that doesn’t help, appearance: none; might help, but it removes completely default styles for your input, so you will have to style all the stuff like :checked mark etc.

E: If you just want to change the background color after checking the input, you can use accent-color (https://developer.mozilla.org/en-US/docs/Web/CSS/accent-color)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading