[CSS] scroll-snap ๊ณผ scroll-behavior
์คํฌ๋กค์ ์ด๋ป๊ฒํ๋๊ฒ ์ข์๊น ๊ณ ๋ฏผํ๋ ์ฐฐ๋ ์ ์น๊ตฌ๋ค์ ์๊ฒ ๋๋ค!
๐scroll-snap
๋ถ๋ชจ์๊ฒ scroll-snap-type : ์ถ ํ์ ; ๋ฅผ ์ฃผ๊ณ ,
์์์๊ฒ scroll-snap-align : ๊ธฐ์ค์ ; ์ ์ฃผ๋ฉด ๋๋ค.
์์)
.container {
scroll-snap-type: y proximity; /* y์ถ์ผ๋ก ์คํฌ๋กค, proximity(๊ทผ์ฒ์ ์์ ๋๋ง ์ค๋
) */
/* mandatory ํ๋ฉด ์์ฃผ ์กฐ๊ธ๋ง ์์ง์ฌ๋ ์๋์คํฌ๋กค์ด ๋จ */
}
.item {
scroll-snap-align: start; /* ์์์ ์์๋ถ๋ถ์ ๋ง์ถค */
}
๐scroll-behavior
scroll-behavior: smooth; ๋ฅผ ์ฃผ๋ฉด ์คํฌ๋กค์ด ๋ถ๋๋ฝ๊ฒ ์ฅ์ฅ ์์ง์ด๊ฒ ๋๋ค.
!!์ฐธ๊ณ !!
www.w3.org/TR/2019/CR-css-scroll-snap-1-20190319/
www.w3schools.com/cssref/pr_scroll-behavior.asp
CSS Scroll Snap Module Level 1
Abstract This module contains features to control panning and scrolling behavior with “snap positions”. CSS is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, etc. Status of this document This
www.w3.org