
- HTML中文网
- 联系QQ:88526
- QQ交流群
- 微信公众号

:read-write 选择器
定义和使用:
:read-write 选择器用于匹配可读及可写的元素。
注意: 目前, 在大多浏览器中, :read-write 选择器只使用于设置了input 和 textarea 元素。
浏览器支持:
| 选择器 | ![]() | ![]() | ![]() | ![]() | ![]() |
| :read-write | 不支持 | -moz- | yes | 支持 | yes |
CSS 语法:
:read-write
{
css 声明;
}<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
input:read-write
{
background-color:pink;
}
</style>
</head>
<body>
<p>将input元素没有设置read-only属性,设置为粉色</p>
<input>
</body>
</html>点击 "运行实例" 按钮查看在线实例
效果图:






推荐手册