I am facing a problem I am trying to figure out how can I update my html checkbox in such a ways that once it is checked instead of tick ✔️ inside I place a small white squared div with lesser dimensions as shown in the attached picture. when I un-check it just a normal black background checkbox with white-border.
I placed some efforts here
=>
https://jsbin.com/xejupuziqi/edit?html,css,output,
but out of luck, unfortunately.
3
Answers
Upon some research into this, using the pure html ‘checkbox’ this is impossible due to CSS not giving enough flexibility into this specific area.
However this would certainly be possible if you were to re-create the check box functionality by yourself, I’ll try and work on a little base for how this might look:
Then if you need to check if the div is checked or not then you can just test if the checkbox has an img source as a child or not.
This should work if your only goal is to have a white box inside, This works by using both a
border
and anoutline