Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
parasti
1y ago
0 comments
Save
Share
You can't style the label based on input state if you do that. If you instead order them like input + label, then you can style the label with selectors like input:checked + label.
0 comments
1 comments · 1 top-level
top
newest
oldest
agos
1y ago
you can, with the power of :has!
label:has(input:checked) { background-color: orange; }
j
/
k
navigate · click thread line to collapse