Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

CSS로 활성화된 모든 요소 스타일 지정


활성화된 모든 요소의 스타일을 지정하려면 CSS :enabled 선택기를 사용하세요.

예시

다음 코드를 실행하여 활성화된 요소

의 스타일을 지정할 수 있습니다.

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