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

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

<시간/>

비활성화된 모든 요소의 스타일을 지정하려면 CSS :disabled 선택기를 사용하세요. 비활성화된 요소의 스타일을 지정하기 위해 다음 코드를 실행할 수 있습니다 -

예시

<!DOCTYPE html>
<html>
   <head>
      <style>
         input:enabled {
            background: blue;
         }
         input:disabled {
            background: red;
         }
      </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>