CSS - Pseudo Classes

css

// CSS Pseudo Classes:

a:active
a:hover
a:link
a:visited
input:valid
input:checked
input:disabled
input:enabled
input:focus
input:optional
input:out-of-range
input:read-only
input:read-write
input:required
input:in-range // Selects <input> elements with a value within a specified range
input:invalid // Selects all <input> elements with an invalid value
p:lang(it) // Selects every <p> element with a lang attribute value starting 
  with "it"
p:empty  // Selects every <p> element that has no children
p:first-child // Selects every <p> elements that is the first child of its parent
p:first-of-type // Selects every <p> element that is the first <p> element of 
  its parent
p:last-child
p:last-of-type
:not(p) // Selects every element that is not a <p> element
p:nth-child(2) // Selects every <p> element that is the second child of its 
  parent
p:nth-last-child(2) // Selects every <p> element that is the second child of its 
  parent, counting from the last child
p:nth-last-of-type(2)
p:nth-of-type(2)
p:only-of-type // Selects every <p> element that is the only <p> element of its 
  parent
p:only-child // Selects every <p> element that is the only child of its parent
:root // Selects the document's root element
#news:target // Selects the current active #news element
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License