• 회원가입
  • 로그인
  • 구글아이디로 로그인

[selector] CSS - :autofill 가상선택자 - 브라우저 자동완성 채우기로 입력된 요소 선택 (= :autofill선택자 = 오토필선택자)

목차
  1. :autofill 예제 - 브라우저 자동완성 채우기로 입력된 요소 선택
  2. :autofill 정의
  3. :autofill 구문

 

:autofill 예제 - 브라우저 자동완성 채우기로 입력된 요소 선택

 

<style>

input:autofill {

  border: 2px solid red;

}

</style>


<form>

<label for="name">이름: </label><br>

<input id="name" name="name" type="text" autocomplete="name" /><br>


<label for="email">이메일: </label><br>

<input id="email" name="email" type="email" autocomplete="email" /><br>


<label for="home-address">주소:</label><br>

<input name="address" type="text" autocomplete="street-address"><br>


<label for="country">국적: </label><br>

<input id="country" name="country" type="text" autocomplete="country-name" />

</form>

 

결과보기

 

:autofill 정의

 

autocomplete 속성 가진 <input> 요소를 브라우저 자동완성 채우기로 입력시 해당 INPUT 요소를 선택하는 선택자.

 


PS.

  • 주의: 자동완성 채우기로 채운 값을 사용자가 수정하면 더 이상 이 선택자의 영향을 받지 않음.
  • CSS2
  • IE 제외한 주요 최신 브라우저 모두 지원.

 

 

:autofill 구문

 

:autofill { CSS 선언 }

 

 


분류 제목
selector CSS - :defined 가상선택자 - 표준태그 및 사용자정의태그 선택 (= :defined선택자 = 디파…
selector CSS - :focus-visible 가상선택자 -
selector CSS - ::backdrop 가상선택자 -
selector CSS - :first 가상선택자 -
selector CSS - :focus-within 가상선택자 -
selector CSS - :where() 가상선택자 -
selector CSS - :autofill 가상선택자 - 브라우저 자동완성 채우기로 입력된 요소 선택 (= :autofil…
selector CSS - :default 가상선택자 -
selector CSS - :state() 가상선택자 -
selector CSS - :dir() 가상선택자 -
selector CSS - :fullscreen 가상선택자 -
selector CSS - :user-valid 가상선택자 -
selector CSS - :is() 가상선택자 - 여러 선택자 동시 선택 (= is선택자 = 이즈선택자)
selector CSS - :left 가상선택자 -
1/27
목록
찾아주셔서 감사합니다. Since 2012