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

CSS의 역할 :체크된 선택기

<시간/>

CSS :checked 선택기를 사용하여 선택된 모든 요소의 스타일을 지정합니다. 다음 코드를 실행하여 :checked 선택기를 구현할 수 있습니다.

예시

<!DOCTYPE html>
<html>
   <head>
      <style>
         input:checked {
            height: 20px;
            width: 20px;
         }
      </style>
   </head>
   <body>
      <p>Fav sports:</p>
      <form action="">
         <input type = "checkbox" value = "Football">Football<br>
         <input type = "checkbox" value = "Cricket">Cricket<br>
         <input type = "checkbox" checked = "checked" value = "Tennis"> Tennis<br>
         <input type = "checkbox" value = "Badminton">Tennis
      </form>
   </body>
</html>

출력

CSS의 역할 :체크된 선택기