[260214] TIL

Today I Learned (2026-02-14)

CSS μ• λ‹ˆλ©”μ΄μ…˜ 핡심 정리

참고 링크

transition

  • μƒνƒœ λ³€ν™” μ‹œ CSS ν”„λ‘œνΌν‹° 값을 일정 μ‹œκ°„ λ™μ•ˆ λΆ€λ“œλŸ½κ²Œ λ°”κΏ”μ£ΌλŠ” 속성
  • :hoverλ‚˜ JS 이벀트둜 μƒνƒœκ°€ λ°”λ€” λ•Œ 자주 μ‚¬μš©
  • 자체적으둜 μŠ€νƒ€μΌμ„ λ§Œλ“œλŠ” κΈ°λŠ₯이 μ•„λ‹ˆλΌ, λ³€ν™” 과정을 λΆ€λ“œλŸ½κ²Œ ν•˜λŠ” κΈ°λŠ₯
div {
  width: 100px;
  height: 50px;
  background-color: red;
  transition-property: width, background-color;
  transition-duration: 2s, 2s;
}

div:hover {
  width: 300px;
  background-color: blue;
}

animation (@keyframes)

  • μ‹œκ°„ 흐름에 따라 λ‹¨κ³„μ μœΌλ‘œ μ›€μ§μž„μ„ μ •μ˜ν•  수 μžˆλŠ” κΈ°λŠ₯
  • 반볡, λ°©ν–₯, μ§€μ—° λ“± μ œμ–΄ μ˜΅μ…˜μ΄ 풍뢀함

transform

  • 이동, νšŒμ „, ν™•λŒ€/μΆ•μ†Œ, λΉ„ν‹€κΈ° 같은 κΈ°ν•˜ λ³€ν˜•μ„ 적용
  • 자체 μ• λ‹ˆλ©”μ΄μ…˜ κΈ°λŠ₯은 μ—†μœΌλ―€λ‘œ transitionκ³Ό ν•¨κ»˜ μ“°λŠ” κ²½μš°κ°€ 많음

transform-origin

  • λ³€ν˜•μ˜ 기쀀점 μ§€μ •
  • 예: 0 0(μ’Œμƒλ‹¨), 50% 50%(쀑앙), 100% 100%(μš°ν•˜λ‹¨)

μ„±λŠ₯ 관점

  • transform, opacity, filter 기반 μ• λ‹ˆλ©”μ΄μ…˜μ΄ 비ꡐ적 μ„±λŠ₯ μ΅œμ ν™”μ— μœ λ¦¬ν•˜λ‹€.

Categories:

Updated:

Leave a comment