CSS: optional selectors
CSS selectors complete reference manual
Examples
If the input element is not set "required" attribute set its yellow:
input:optional
{
background-color: yellow;
}
{
background-color: yellow;
}
try it"
Definitions and use
: Optional selector to specify style in the form elements are options.
If form elements are not particularly set required properties is optional attribute.
Note:: optional selector only applies to form elements: input, select, and textarea.
Browser Support
Figures in the table represent the first browser to support the version number of the property.
选择器 | |||||
---|---|---|---|---|---|
:optional | 10.0 | 10.0 | 4.0 | 5.0 | 10.0 |
CSS Syntax
:optional
{
css 声明 ;
}
{
css 声明 ;
}
Related Pages
CSS Selector : required