CSS3选择器 :read-write选择器
“:read-write”选择器刚好与“:read-only”选择器相反,主要用来指定当元素处于非只读状态时的样式。
例如:设置不是只读控件的文本框边框为2px solid red
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>属性选择器</title> <style> form { width: 300px; padding: 10px; border: 1px solid #ccc; margin: 50px auto; } form > div { margin-bottom: 10px; } input[type="text"]{ border: 1px solid orange; padding: 5px; background: #fff; border-radius: 5px; } input[type="text"]:-moz-read-only{ border-color: #ccc; } input[type="text"]:read-only{ border-color: #ccc; } input[type="text"]:-moz-read-write{ border:2px solid red; } input[type="text"]:read-write{ border:2px solid red; } </style> </head> <body> <form action="#"> <div> <label for="name">姓名:</label> <input type="text" name="name" id="name" placeholder="大漠" /> </div> <div> <label for="address">地址:</label> <input type="text" name="address" id="address" placeholder="中国上海" readonly="readonly" /> </div> </form> </body> </html>
Dcr163的博客
http://dcr163.cn/137.html(转载时请注明本文出处及文章链接)