Skip to content

Instantly share code, notes, and snippets.

View CarlosMadeira's full-sized avatar

CarlosMadeira

View GitHub Profile
@Boldewyn
Boldewyn / Proposal for CSS :for() pseudo-class.md
Last active January 21, 2021 19:33
CSS Selectors to Match `label` Elements

CSS Selectors to Match label Elements

<label> elements are notoriously hard to select with CSS in any non-trivial mark-up structure, when the state of their control is to be taken into account. Consider these frequent cases, where it is not possible to reach the label element with CSS selectors, when the corresponding input state is relevant:

1. <label><input> Input inside label</label>

2. <tr>
    <td><input></td>
 Good ol' tables