:empty

Posted by & filed under E.

The :empty pseudo selector will select elements that contain either nothing or only an HTML comment. div:empty { display: none; } Will Match <div></div> <div><!– test –></div> Will Not Match <div> </div> <div> <!– test –> </div> <div> </div> It’s useful for hiding empty elements that might cause weird spacing (e.g. they have padding). Or something like

Continue reading →

Descendant

Posted by & filed under D.

A descendant selector in CSS is any selector with white space between two selectors without a combinator. Here’s some examples: ul li { } header h2 { } footer a { } .module div { } #info-toggle span { } div dl dt a { } Take ul li { } for example. It means “any list item

Continue reading →

:disabled

Posted by & filed under D.

The :disabled pseudo-class selector provides conditional styling to HTML elements that can receive user input, when the elements have the disabled attribute. It is defined in the CSS Selectors Level 3 spec as a “UI element state pseudo-class”, meaning it is used to style content based on the user’s interaction with an input element. Elements that can receive the disabled attribute include <button>, <input>,<textarea>, <optgroup>, <option> and <fieldset>. There

Continue reading →

:default

Posted by & filed under D.

The :default pseudo selector will match the default in a group of associated elements, such as the radio button in a group of buttons that is selected by default, even if the user has selected a different value. input[type=”radio”]:default + label:after { content: ‘ (default)’; color: #999; font-style: italic; } The CSS above targets the

Continue reading →