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

CSS로 호버 효과의 속도 설정

<시간/>

호버의 속도를 설정하려면 transition-duration 속성을 사용하십시오. 호버를 설정하려면 :hover 선택기를 사용하세요.

예시

호버 효과를 빠르게 하기 위해 다음 코드를 실행할 수 있습니다 -

<!DOCTYPE html>
<html>
   <head>
      <style>
         .btn {
            background-color: yellow;
            color: black;
            text-align: center;
            font-size: 15px;
            padding: 20px;
            border-radius: 15px;
            border: 3px dashed blue;
            transition-duration: 2s;
         }
         .btn:hover {
            background-color: orange;
            color: black;
            border: 3px solid blue;
         }
      </style>
   </head>
   <body>
      <h2>Result</h2>
      <p>Click below for result:</p>
      <button class = "btn">Result</button>
   </body>
</html>