<style>
.transition {
transform : rotate(45deg);
transform : scale(2,3):
}
</style>
<style>
.transition {
transform : skew(10deg, 20deg);
transform : translate(100px,200px):
}
</style>
<style>
.transition {
-webkit-transform: translate(100px, 200px); /*크롬 사파리*/
-moz-transform: translate(100px, 200px); /*파이어폭스*/
-ms-transform: translate(100px, 200px); /*익스플로러 9.0*/
-o-transform: translate(100px, 200px); /*오페라*/
}
</style>
<style>
.transition {
trnasition-property: width;
transition-duration: 2s;
}
</style>
<style>
.transition {
trnasition-timing-function: linear;
transition-delay: 1s;
}
</style>
<style>
.transition:hover {
width:300px;
}
</style>
css에서 미리 만들어 놓은 클래스로, 마우스를 올렸을 때라는 조건.
:hover를 띄어쓰기 없이 붙여서 작성해야 한다.
<style>
.transition {
transition: width 2s linear 1s;
}
.transition:hover {
width: 300px;
}
</style>
=> 마우스를 올리면 1초 후에 width 값이 300px 로 2초동안 속도 일정하게 변하는 애니메이션 효과 발동.
.animation {
animation-name: changeWidth; /* 애니매이션 이름 */
animation-duration: 3s;
animation-timing-function: linear;
animation-delay: 1s;
animation-iteration-count: 6;
animation-direction: alternate;
}
@keyframes changeWidth {
from { width: 300px; }
to {width: 600px; ]
}
.box1 {
animation: rotation 1500ms linear infinite alternate;
}
@keyframes rotation {
from { transform: rotate(-10deg); }
to { transform: rotate(10deg); }
}
애니메이션 코드를 한줄로 작성 시, 먼저 나오는 숫자가 duration 이고 나중에 나오는 숫자가 delay.
순서를 변경해 작성하지 않도록 주의한다.
.box1 {
-webkit-animation: rotation 3s linear 1s 6 alternate;
}
@-webkit-keyframes rotation {
from {-webkit-transform: rotate(-10deg); }
to {-webkit-transform: rotate(10deg); }
}
prefix가 같은 애니메이션끼리 연동된다.