Usage of CSS :focus pseudo-class

王林
Release: 2023-08-26 15:01:08
forward
1420 people have browsed it

You can try to run the following code to achieve: focus pseudo-class

Example

Live demonstration

<!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>
Copy after login

Output

CSS :focus 伪类的用法

The above is the detailed content of Usage of CSS :focus pseudo-class. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template