小白教程
所有教程
关于
Search
172.69.58.69
172.69.58.69
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Sel enable”的源代码
本页内容
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE::enabled}}[[Category:css pseudo classes|4]] = CSS3 :enabled 选择器 = [[css selectors|完整CSS选择器参考手册]] 设置所有type="text"的启用的输入元素的背景颜色: <sample title="" desc="" lang="html" hererun="1"> input[type="text"]:enabled { background:#ffff00; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> input[type="text"]:enabled { background:#ffff00; } input[type="text"]:disabled { background:#dddddd; } </style> </head> <body> <form action=""> First name: <input type="text" value="Mickey" /><br> Last name: <input type="text" value="Mouse" /><br> Country: <input type="text" disabled="disabled" value="Disneyland" /><br> </form> </body> </html> </run> == 定义和用法 == :enabled 选择器匹配每个启用的的元素(主要用于表单元素)。 == 浏览器支持 == 表格中的数字表示支持该属性的第一个浏览器版本号。 {| class="table table-striped table-hover" ! 选择器 ! Chrome ! Internet Explorer / Edge ! Firefox ! Safari ! Opera |- | :enabled | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |} == 更多实例 == 为所有启用的输入元素设置背景色: <sample title="" desc="" lang="html" hererun="1"> input:enabled { background:#ffff00; } </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <style> input:enabled { background:#ffff00; } input:disabled { background:#dddddd; } </style> </head> <body> <form action=""> First name: <input type="text" value="Mickey" /><br> Last name: <input type="text" value="Mouse" /><br> Country: <input type="text" disabled="disabled" value="Disneyland" /><br> Password: <input type="password" name="password" /> <input type="radio" value="male" name="gender" /> Male<br> <input type="radio" value="female" name="gender" /> Female<br> <input type="checkbox" value="Bike" /> I have a bike<br> <input type="checkbox" value="Car" /> I have a car </form> </body> </html> </run> [[css selectors|完整CSS选择器参考手册]]
返回至“
Sel enable
”。