국비지원 JAVA 풀스택 과정/HTML+CSS3

[HTML+CSS3] 반응선택자

ODaram 2022. 9. 27. 14:30
반응 선택자

  반응 선택자

:active - 사용자가 요소에 클릭한 순간을 선택한다. (클릭한 상태가 지속되지 않는다.)
:hover - 사용자가 요소에 마우스 포인터를 올린 상태를 선택한다.
 <!DOCTYPE html>
 <html lang="ko">
 <head>
   <meta charset="UTF-8">
   <meta http-equiv="X-UA-Compatible" content="IE=edge">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>반응 선택자</title>
 </head>
 <style>
   .box {
     width:200px; height:300px;
     background:indigo;
     transition:all 0.4s ease-in;
     /*적용할 스타일 속성, duration(진행시간), 베지어 곡선(가속도), 대기시간*/
   }
   .box:hover {
     border-radius:50%; 
     }
 </style>
 <body>
   <div class="box"></div>
 </body>
 </html>

반응 선택자를 적용해 마우스 오버 시 스타일 적용 한 모습