CSS3 - pseudo classes - UI element

:enabled

A user interface element that is enabled.


  button:enabled {
      border: 1pt solid blue;
  }
  

  <button>An enabled button</button>
  

:disabled

A user interface element that is disabled.


  button:disabled {
      border: 1pt solid red;
  }
  

  <button disabled>A disabled button</button>
  

:checked

A user interface element that is checked. For checkboxes and radio buttons only.


  input:checked {
      background-color: orange;
  }
  

  <div>
      <input type="radio" name="genderSelect" id="male" value="m"> <label for="male">Male</label>
      <input type="radio" name="genderSelect" id="female" value="f"> <label for="female">Female</label>
  </div>
  <input type="checkbox" id="over18"><label for="over18">Over 18?</label>
  

Ads by Google



Ask a question, send a comment, or report a problem - click here to contact me.

© Richard McGrath