.circle {
width: 300px;
height: 300px;
transition: 1s;
}
.circle {
border-radius: 50%
}
/* 원으로는 즉시 변하도록 하면서 background-color 변화에만 3초의 트랜지션을 주고 싶을 때 */
.circle {
transition: background-color 3s;
}
/* 딜레이를 주고싶을 때 (1초 후에 트랜지션이 일어남) */
.circle {
transition: background-color 3s 1s;
}
transform: rotate(45deg); 45로 돌아감
transform-origin: bottom right; 오른쪽 하단을 기준으로 돌아감.
rotateX() / rotateY(); X축, Y축을 기준으로 돌아감
scale(0.5); 부피를 반으로 줄임
scale(2, 1); height은 그대로이나 width는 2로 늘어남
scaleY(2); Y축 기준으로 2로 늘어남 (height만 2배로 늘어남)
translateX(200px); x축 위에서 200px만큼 옮김
translate(-100px, 50px); x축에서 -100(좌), y축에서 50(아래)
skew(30deg); 30도로 비틀림 (원형으로 돌아가는 것이 아니라 대상 자체가 왜곡됨)
해당 기능들은 중복해서 사용할 수 있음.
transform: translateX(-500px) rotate(0.5turn) scaleY(0.5);
button {
color: #ffa260;
background: none;
border: 2px solid;
padding: 1em 2em;
font-size: 1em;
transition: all 0.25s;
}
button:hover {
border-color: #f1ff5c;
color: #f1ff5c;
box-shadow: 0 0.5em 0.5em -0.4em #f1ff5c;
transform: translateY(-0.24em);
cursor: pointer;
}
center / 80%*html 줄바꿈 사이에는 ‘ ‘ 공백이 항상 숨어있다.