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

CSS 전환 속성


CSS 전환 속성을 사용하여 네 가지 전환 속성을 모두 한 줄로 설정합니다. 다음 코드를 실행하여 transition 속성을 사용할 수 있습니다 -

예시

<!DOCTYPE html>
<html>
   <head>
      <style>
         div {
            width: 150px;
            height: 150px;
            background: blue;
            transition: height 3s;
         }
         div:hover {
            height: 250px;
         }
      </style>
   </head>
   <body>
      <h1>Heading One</h1>
      <p>Hover over the below box to change its height.</p>
      <div></div>
   </body>
</html>