x
1
2
<html>
3
<head>
4
<meta charset="utf-8">
5
<style>
6
input:valid {
7
background-color: yellow;
8
}
9
</style>
10
</head>
11
<body>
12
13
<h3> :valid 选择器实例演示。</h3>
14
15
<input type="email" value="support@exampel.com" />
16
17
<p>请输入非法 e-mail 地址,查看样式变化。</p>
18
19
</body>
20
</html>