您好,欢迎访问一九零五行业门户网

CSS :focus 伪类的用法

您可以尝试运行以下代码来实现 :focus 伪类
示例现场演示
<!doctype html><html> <head> <style> input:focus { background-color: orange; } </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"><br> <input type = "submit" value = "submit"> </form> </body></html>
输出
以上就是css :focus 伪类的用法的详细内容。
其它类似信息

推荐信息