transition 은 css 의 속성값(color, width, font 등) 을 일정시간동안 변화할 수 있게 해주는 속성이다.
1. transition-property
transition-property 는 transition 이 되는 속성값을 지정할 수 있다.
p {
transition: 2s 1s;
transition-property: width color;
width: 150px;
height: 150px;
color: red;
}
p:hover {
width: 250px;
color: blue;
}
transition-property 를 통해 width 와 color 속성만 변화할 수 있게 지정했다. 각각 width 는 2s, color 는 1s 동안 변하게 된다.
2. transition
transition 과 관련한 여러가지 속성들(transition-property, delay, duration, timing-function)을 transition : ~ 를 통해 한번에 사용할 수 있다.
transition : property duration timing-function delay
'CSS' 카테고리의 다른 글
| [CSS] 상속(Inheritance) (0) | 2023.01.15 |
|---|---|
| [CSS] float 사용할 때 나오는 문제점들 (0) | 2023.01.15 |
| [CSS] position : static, relative, absolute, fixed 정리 (0) | 2023.01.14 |
| [CSS] block, inline, inline-block 정리 (0) | 2023.01.14 |
| [CSS] border-radius 정리 (0) | 2023.01.14 |