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

CSS3 전환 약식 속성

<시간/>

transition 속기 속성을 사용하면 transition-property, transition-duration, transition-timing function 및 transition-delay를 한 줄에 transition 속성에 대한 값으로 지정할 수 있습니다.

다음은 CSS의 전환 약식 속성에 대한 코드입니다 -

예시

<!DOCTYPE html>
<html>
<head>
<style>
.container div {
   width: 300px;
   height: 100px;
   border-radius: 1px;
   background-color: rgb(25, 0, 255);
   border: 2px solid red;
   transition: border-radius 2s ease 1s, background-color 2s ease-out 1s ;
}
.container:hover div {
   background-color: purple;
   border-radius: 50%;
}
</style>
</head>
<body>
<h1>Transition shorthand property</h1>
<div class="container">
<div></div>
</div>
<h2>Hover over the above div to change its color and its shape to oval</h2>
</body>
</html>

출력

위의 코드는 다음과 같은 출력을 생성합니다 -

CSS3 전환 약식 속성

CSS3 전환 약식 속성