示例您可以尝试运行以下代码来为启用的元素设置样式
在线演示
<!doctype html><html> <head> <style> input:enabled { background: blue; } </style> </head> <body> <form action = ""> subject <input type = "text" name = "subject"><br> student: <input type = "text" name = "student"><br> age: <input type = "number" name = "age" disabled><br> </form> </body></html>
以上就是使用 css 设置每个启用元素的样式的详细内容。
