mozilla

Revision 35639 of :optional

  • Revision slug: CSS/:optional
  • Revision title: :optional
  • Revision id: 35639
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment new page; page created, 79 words added

Revision Content

{{ CSSRef() }}{{ gecko_minversion_header("2.0") }}

Summary

The :optional CSS pseudo-class is applied automatically to {{ HTMLElement("input") }} elements that do not have the required attribute set on them. This allows forms to easily indicate optional fields.

You may use the {{ cssxref(":required") }} pseudo-class to provide an appearance for required form fields.

Browser compatibility

Browser Lowest version
Internet Explorer ---
Firefox (Gecko) 4.0 (2.0)
Opera ?
Safari (WebKit) ?

Specifications

See also

  • {{ cssxref(":required") }}
  • {{ cssxref(":invalid") }}
  • {{ cssxref(":valid") }}

Revision Source

<p>{{ CSSRef() }}{{ gecko_minversion_header("2.0") }}</p>
<h3>Summary</h3>
<p>The <code>:optional</code> CSS pseudo-class is applied automatically to {{ HTMLElement("input") }} elements that do not have the required attribute set on them. This allows forms to easily indicate optional fields.</p>
<p>You may use the {{ cssxref(":required") }} pseudo-class to provide an appearance for required form fields.</p>
<h3>Browser compatibility</h3>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest version</th> </tr> <tr> <td>Internet Explorer</td> <td>---</td> </tr> <tr> <td>Firefox (Gecko)</td> <td>4.0 (2.0)</td> </tr> <tr> <td>Opera</td> <td>?</td> </tr> <tr> <td>Safari (WebKit)</td> <td>?</td> </tr> </tbody>
</table>
<h3>Specifications</h3>
<ul> <li><a class=" external" href="http://www.w3.org/TR/css3-ui/#pseudo-required-value" title="http://www.w3.org/TR/css3-ui/#pseudo-required-value">CSS 3 Basic User Interface Module</a></li>
</ul>
<h3>See also</h3>
<ul> <li>{{ cssxref(":required") }}</li> <li>{{ cssxref(":invalid") }}</li> <li>{{ cssxref(":valid") }}</li>
</ul>
Revert to this revision