English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
:disabled CSS 피클스는 어떤 비활성화된 요소도 나타냅니다. 요소가 활성화되지 않을 수 없다면(예: 선택, 클릭 또는 텍스트 입력을 받는 경우) 또는 포커스를 받을 수 없다면, 이 요소는 비활성화 상태입니다. 요소는 또한 활성화 상태(enabled state)가 있습니다. 활성화 상태에서 요소는 활성화되거나 포커스를 받을 수 있습니다.
모든 type="text"의 비활성화된 입력 요소의 배경색을 설정하십시오:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>기본 가이드(w3(codebox.com)</title> <style> input[type="text"]:enabled { background:yellow; } input[type="text"]:disabled { background:#dddddd; } </style> </head> <body> <form action=""> 이름: <input type="text" value="Mouse"> /><br> 지역: <input type="text" disabled="disabled" value="Disneyland"> /><br> </form> </body> </html>테스트를 보고 보세요 ‹/›
:disabled 선택자는 모든 비활성화된 요소를 매칭합니다(주로 양식 요소를 사용합니다).
표의 숫자는 이 속성을 지원하는 첫 번째 브라우저 버전 번호를 나타냅니다。
선택자 | |||||
---|---|---|---|---|---|
:disabled | 4.0 | 9.0 | 3.5 | 3.2 | 9.6 |
모든 비활성화된 입력 요소에 배경색을 설정합니다:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>기본 가이드(w3(codebox.com)</title> <style> input:enabled { background:yellow; } input:disabled { background:#dddddd; } </style> </head> <body> <form action=""> First name: <input type="text" value="Mickey" /><br> Last name: <input type="text" value="Mouse" /><br> Country: <input type="text" disabled="disabled" value="Disneyland" /><br> Password: <input type="password" name="password" /> <input type="radio" value="male" name="gender" /> Male<br> <input type="radio" value="female" name="gender" /> Female<br> <input type="checkbox" value="Bike" /> I have a bike<br> <input type="checkbox" value="Car" /> I have a car </form> </body> </html>테스트를 보고 보세요 ‹/›