HTML and CSS Reference
In-Depth Information
An element is considered empty if it has no child elements, text, or whitespace
except for comments. The preceding rule applies to the following two paragraphs:
<p><!-- also empty --></p>
The :root pseudo-class matches the topmost element in the document tree. In HTML
documents, it is always the <html> element.
:root {} /* root element */
This pseudo-class is mainly useful when CSS is used with other languages,
such as XML, in which the root element can vary. All major browsers support the :root
pseudo-class, except for IE8 and below.
User interface pseudo-classes
CSS 3 introduced a number of user interface pseudo-classes that are used to style
interactive elements based on their current state.
enabled and disabled
The :enabled and :disabled pseudo-classes match any element of the selected type that
is either enabled or disabled. They apply only to interactive elements that can be in either
an enabled or disabled state, such as form elements.
input:enabled { background: green; }
input:disabled { background: red; }
The following form contains one enabled and one disabled input element, which are
affected by these two rules:
<input type="text" name="enabled">
<input type="text" name="disabled" disabled>
These two pseudo-classes are supported by all major browsers except for IE8
and below.
Search WWH ::

Custom Search