CSS: required selectors
CSS selectors complete reference manual
Examples
If the input element is set "required" attribute set its yellow:
input:required
{
background-color: yellow;
}
{
background-color: yellow;
}
try it"
Definitions and use
: Required selector form element is required when you set the specified style.
Form elements can be used to set the required attributes required.
Note:: required 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.
选择器 | |||||
---|---|---|---|---|---|
:required | 10.0 | 10.0 | 4.0 | 5.0 | 10.0 |
CSS Syntax
:required
{
css 声明 ;
}
{
css 声明 ;
}
Related Pages
CSS selector : optional