tip-archive
tip-archive copied to clipboard
CSS transition tip and trick
Description
height transition
- height: 100% → 0px
이렇게 transition을 먹일 경우, 먹지 않는다. max-height를 100%로 크게 먹히고 max-height를 기준으로 transition을 먹인다.
.normal {
height: 100%
max-height: 500px;
transition: max-height .3s;
}
.expand {
max-height: 0px; # or target height pixcel value
}