Skip to content

Instantly share code, notes, and snippets.

@Curookie
Last active March 25, 2022 11:31
Show Gist options
  • Save Curookie/ed1578a3fe453b31d7982b77fa6e7e7b to your computer and use it in GitHub Desktop.
Save Curookie/ed1578a3fe453b31d7982b77fa6e7e7b to your computer and use it in GitHub Desktop.
CSS

vh / vw와 %의 차이

vw와 vh를 사용하여 body의 크기를 설정한 경우(100으로), 스크롤바가 발생되게 됩니다.

%의 경우는 그렇지 않고요.

vw와 vh에서 스크롤바가 발생한 이유는 viewport가 스크롤바의 영역을 포함하기 때문입니다.

vh = viewport height
vw = viewport width

z-index를 적용하려면 position:~~ 속성을 반드시 적용해야한다.

position: absolute는 부모가 position: relative 명시 되어있어야 부모 기준으로 bottom,top,left,right 이런값들을 적용 가능

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment