CSS3选择器 :disabled选择器
“:disabled”选择器刚好与“:enabled”选择器相反,用来选择不可用表单元素。要正常使用“:disabled”选择器,需要在表单元素的HTML中设置“disabled”属性。
例如:让不可用按钮显示为灰色。
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>属性选择器</title>
<style>
input[type='submit']:disabled{
background:#999;
border:rgba(25,25,8,0.5);
}
</style>
</head>
<body>
<form action="#">
<div><input type="text" /></div>
<div>
<input type="submit" value="我要回到上一步" />
<input type="submit" value="禁止点下一步" disabled />
</div>
</form>
</body>
</html> Dcr163的博客
http://dcr163.cn/133.html(转载时请注明本文出处及文章链接)
