transition-property
transition-duration
transition-timing-function
transition-delay
.box {
transition-property: width;
transition-duration: 0.5s;
transition-timing-function: ease-in-out;
transition-delay: 0.2s;
}
transform-origin
translate()
rotate()
scale()
.box {
transform: translateX(100px) rotate(45deg) scale(1.2);
}
[예시]
.box {
border-style: solid;
border-width: 1px;
display: block;
width: 100px;
height: 100px;
background-color: #0000ff;
transition: width 2s, height 2s, background-color 2s, rotate 2s;
}
.box:hover {
background-color: #ffcccc;
width: 200px;
height: 200px;
rotate: 180deg;
}
👍🏻마우스를 올렸을 때 180도 회전하면서 배경과 크기가 달라진다.
앞서 transition을 2s로 설정해놔 2초동안 transform이 달라진다.