요소 이동
#id1{transform : translate(50px, 100px);}
/* 요소를 x축으로 50px y축으로 100px만큼 이동 */
#id2{transform : translate(-50%, 50%);}
/* 요소를 x축으로 요소 너비의 50프로만큼 -방향으로 이동*/
/* 요소를 y축으로 요소 높이의 50프로만큼 +방향으로 이동 */
요소 회전
#id1{transform : rotate(20deg);}
/* 요소를 시계방향으로 20도 만큼 회전 */
요소 크기 변경
#id1{transform : scale(1.5);}
/* 요소의 크기를 1.5배만큼 변경 */
요소 기울이기
#id1{transform : skew(20deg, 10deg);}
/* x축에 대하여 20도만큼 기울이기 */
/* y축에 대하여 10도만큼 기울이기 */
#id2{transform : skew(20deg);}
/* == transform:skew(20deg, 0); */
전환
요소의 속성 값이 변할 때, 속도나 시간을 지정하여 자연스러운 효과를 줌
속성
@keyframes Rule
animation 속성
div{
width: 100px;
height:100px;
background:red;
animation-name : example;
animation-duration : 4s;
animation-timing-function : linear;
animation-iteration-count:infinite;
animation-direction:alternate;
position: relative;
}
@keyframes example{
0% {background-color:red; left: 0; top: 0;}
50% {background-color:green; left: 200px; top: 0;}
100% {background-color:blue; left: 200px; top: 200px;}
}