HTML checkbox ?
In my html , the checkbox mark colour does not work properly , is it normal or some kind of error , plc guide me...any solution ???
3 Replies
You say that "the checkbox mark colour does not work properly" but give no indication of how you expect it to behave. As far as I can see from your screen capture, it looks to have worked as expected.
In general HTML form elements such as checkboxes, radio buttons and select lists are notoriously difficult to style as browsers prefer to enforce their style according to the general styling, hence the differences from browser to browser.
That said, it is not impossible to do, it just requires more CSS.
You can either hide them and generate pseudo elements (without loosing the functionality) or use various CSS styles to reset their defaults with something like this:
You then add in the styling that we want just like any other HTML element.
ok got it, thanks for this advice
I made my own styled checkbox, that I normally use cause I have more control than using an accent color.
https://codepen.io/23chromosomes/pen/wvLWVgo
But if you just want a different color, use this:
On the checkbox to style the checkmark background color.
https://codepen.io/23chromosomes/pen/GRbjKKm