要选择具有焦点的元素,请使用:焦点选择器。您可以尝试运行以下代码来实现:焦点选择器 -
示例<!doctype html><html> <head> <style> input:focus { background-color: green; } </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 的元素的详细内容。