<html>
<head>
<style>
input:valid {
background-color: yellow;
}
</style>
</head>
<body>
<h1>演示 :valid 选择器</h1>
<input type="email" value="support@example.com">
<p>请尝试输入一个非法的电子邮件地址,来查看样式消失。</p>
<p><b>注释:</b>Internet Explorer 9 以及更早的版本不支持 :valid 选择器。</p>
</body>
</html>