by using ‘label’. I’ve also tried using label[for=full]:checked, and that doesn’t seem to work either. All examples I am seeing online are exactly what I am trying, but none seem to pass.
I am struggling on another project where I have to style a label. I must not understand how to style a label element properly. If it is not styled like every other element, that would be why I am struggling.
This is targeting an input radio button that has been checked. That is something that can be checked, which is why this works. But this doesn’t say anything about the associated label.
I do not understand how to use input[type=“radio”]:checked to change the style of the associated label.
On another project, I am using
label {
text: blue;
margin: 20px;
}
and it is also not styling the label at all. I am at a loss as to what is to be done. Researching online has not brought me any solutions to my problem.
Can you explain with an example on how to properly style it?
You don’t, because that is a selector for a radio button and not a label. You need a selector for the associated label. That syntax is part of it but not all of it.
I put “style label when input checked” into a search engine and got several results. I’m seeing several similar results. What pages did you find?
in what way are you selecting the label? the link you posted alone describes how to select the checked input, to select the associated label you need something more