The :required selector selects form elements which are required. Form elements with a required attribute are defined as required.

:required {
    css declarations;
}
input:required {
   color: #3366ff;
   background: #ffff99;
}

Click the button below to experiment with this selector.

Give it a Try!

4.0Firefox 10.0Explorer 10.0Chrome 5.0Safari 10.0Opera