CSS

[selector] CSS - :disabled 가상선택자 - 비활성화 된 요소 선택 (= 실행불능요소 = 작동불능요소 = :disabled선택자 = 디세이블드선택자/디스에이블드선택자/디서블드선택자) ※ 비활성화요소

목차

  1. :disabled 예제 - <input type='text'> 중 비활성화된 요소 선택
  2. :disabled 정의
  3. :disabled 구문
  4. :disabled 예제 - <input> 중 비활성화 된 요소 선택
  5. :disabled 예제 - <option> 중 비활성화 된 요소 선택

 

:disabled 예제 - <input type='text'> 중 비활성화된 요소 선택 

 

<style> 

input[type=text]:enabled {

  background: yellow;

}


input[type=text]:disabled {

  background: silver;

}

</style>


<form action="">

  사이트: <input type="text" value="홈짱닷컴"><br>

  도메인: <input type="text" value="Homzzang.com"><br>

  오픈년도: <input type="text" disabled="disabled" value="2012">

</form>

 

결과보기

 

:disabled 정의

 

비활성화 된 모든 요소 선택. (주로, <form> 태그 안 입력요소에서 사용.)

 


 

1. cf.
:enabled 가상선택자 - 활성화 된요소 선택.

 

2. 

  • IE9 이상 주요 최신 브라우저 모두 지원.
  • CSS버전: CSS3

 

3. MDN :disabled 예제보기

https://developer.mozilla.org/en-US/docs/Web/CSS/:disabled

 

 

:disabled 구문

 

selector:disabled { css declarations; }

 

PS. selector 없이 단독 사용 시, 모든 비활성화 된 요소 선택.

 

:disabled 예제 - <input> 중 비활성화 된 요소 선택

 

<style> 

input:enabled {

  background: yellow;

}


input:disabled {

  background: silver;

}

</style>


<form action="">

  사이트: <input type="text" value="홈짱닷컴"><br>

  도메인: <input type="text" value="Homzzang.com"><br>

  오픈년도: <input type="text" disabled="disabled" value="2012"><br>

  패스워드: <input type="password" disabled="disabled" value="1234" name="password">

</form>

 

결과보기

 

:disabled 예제 - <option> 중 비활성화 된 요소 선택

 

<style> 

option:disabled {

  background: silver;

}

</style>


<select>

  <option value="">언어선택</option>

  <option value="html">HTML</option>

  <option value="css">CSS</option>

  <option value="javascript">JavaScript</option>

  <option value="php" disabled>PHP</option>

  <option value="sql" disabled>SQL</option>

</select>

 

결과보기



분류 제목
outline CSS - outline-color 속성 - 외곽선두께 (= 아웃라인컬러속성 = outline-color속성…
box CSS - width 속성 ★ - 너비 (= 가로길이 = width속성 = 위드스속성, 상속X)
box CSS - height 속성 ★ - 높이 (= 세로길이 = height속성 = 하이트속성) (※ vh, vw…
box CSS - min-width 속성 - 최소너비 (=최소가로길이 = min-width속성 = 민위드스속성)
box CSS - min-height 속성 - 최소높이 (= 최소세로길이 = min-height속성 = 민하이트속성…
box CSS - max-width 속성 - 최대너비 (= 최대가로길이 = max-width속성 = 맥스위드스속성)
box CSS - max-height 속성 - 최대높이 (= 최대세로길이 = max-height속성 = 맥스하이트속…
font CSS - font 속성 ★ - 글자스타일종합 (= font속성 = 글씨체 = 서체 = 글꼴 = 폰트속성, …
font CSS - font-size 속성 ★ - 글자크기 (= 글씨체크기= 글씨크기 = 서체크기= 글씨크기 = …
font CSS - font-family 속성 ★ - 글자종류 (= font-family속성 = 폰트패밀리속성 = 글…
font CSS - font-weight 속성 ★ - 글자굵기 (= font-weight속성 = 폰트굵기 = 글씨체굵…
font CSS - font-style 속성 - 글자기울기 (= 이텔릭체 여부 = 이탤릭 글씨체 = 글자 기울려쓰기 … 1
font CSS - font-variant 속성 - 작은 대문자 (= font-variant속성 = 폰트베리언트 = …
text CSS - color 속성 ★ - 글자색깔 (=글자색상=글자색깔=글자컬러 = 텍스트색깔 = 컬러속성 = co…
text CSS - direction 속성 - 텍스트방향 (= 텍스트진행방향 = direction속성 = 디렉션속성)…
5/33
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티 2
웹유틸
회원센터
홈짱닷컴 PC버전 로그인