CSS: valid selectors
CSS selectors complete reference manual
Examples
If the input element is entered legally, set it to yellow:
input:valid
{
background-color: yellow;
}
{
background-color: yellow;
}
try it"
Definitions and use
: Valid selector to specify style in the value of the form element needs to be verified according to the specified conditions.
Note:: valid selector can act only on the value of the specified range of elements, such as input elements min and max attributes, and correct email fields, numeric fields, and so legitimate.
Browser Support
Figures in the table represent the first browser to support the version number of the property.
选择器 | |||||
---|---|---|---|---|---|
:valid | 10.0 | 10.0 | 4.0 | 5.0 | 10.0 |
CSS Syntax
:valid
{
css 声明 ;
}
{
css 声明 ;
}
Related Pages
CSS selectors : invalid