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

CSS로 버튼 호버 시 페이드 인


다음 코드를 실행하여 CSS로 버튼을 호버링할 때 페이드 인할 수 있습니다.

예시

<!DOCTYPE html>
<html>
   <head>
      <style>
         .btn {
            background-color: orange;
            color: white;
            padding: 10px;
            text-align: center;
            font-size: 16px;
            margin: 5px;
            opacity: 0.5;
            transition: 0.5s;
            display: inline-block;
            text-decoration: none;
            cursor: pointer;
         }
         .btn:hover {
            opacity: 2
         }
      </style>
   </head>
   <body>
      <button class = "btn">Result</button>
   </body>
</html>