>  기사  >  웹 프론트엔드  >  CSS 사용법 :focus 의사 클래스

CSS 사용법 :focus 의사 클래스

王林
王林앞으로
2023-08-26 15:01:081243검색

다음 코드를 실행하여 구현할 수 있습니다. :focus 의사 클래스

Example

Live 데모

<!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>

Output

CSS :focus 伪类的用法

위 내용은 CSS 사용법 :focus 의사 클래스의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
이 기사는 tutorialspoint.com에서 복제됩니다. 침해가 있는 경우 admin@php.cn으로 문의하시기 바랍니다. 삭제