css - Select child element of element with attribute -
i have button. button has span tag inside of text of button. button may disabled. when disabled, i'd button grey. why doesn't work? first html, css
<button disabled> <span class="dark-disabled">start new game</span> </button> button:disabled span{ background: #ccc; }
but fire if class selector instead:
button:disabled .dark-disabled{ background: #ccc; }
you looking css attribute selector
button[disabled] span{ background: #ccc; }
edit:
i misread question, both :disabled
, [disabled]
work button. sample gave me works fine in firefox: jsfiddle
what browser using?
Comments
Post a Comment