How do I remove the text-decoration from the label::before
https://codepen.io/ananthuk7/pen/mdgXzRp
How do I remove the text-decoration from the label::before when I check the checkbox? I need to add X for my custom check box when it is checked. Also, I can't change the elements. Is there any better solution?
7 Replies
you use the other pseudo element to make that line-through effect 🙂
and add
position: relative;
to .customCheckbox:checked ~ .customLabel
beat me to it...
pretty close though it is a little larger than his container- i think this is what he's looking for (using your solution and the right height)
changed from an "X" to an "M" to more clearly show that the text-decoration: none; actually is working, because the
x
makes it hard in codepen's font choice\
very nice solution Andrew. 🙂
With mine you might wonder where did i get the 32px to subtract for the width. It's the width of the box + gap + border width.
ah smart, i just went with his height/width above, but added 2px for the top/bottom and left/right 1px border
hard to know what they want without getting responses :GoodMeme:
this is what I'm looking for. Thank you.