css의 position
property에 대해 이야기 해보도록 하자.
position: static
position: relative
top, right, bottom, left
값을 지정해주기 전까지는 position: static
과 똑같은 모습으로 보인다.top, right, bottom, left
값 설정시, position: static
을 기준으로 설정한 값만큼 이동한다.position: absolute
position: relative
가 할당된 부모 tag를 기준으로 움직인다.position: relative
가 할당된 부모 tag가 없다면, <body>
를 기준으로 움직인다.top, right, bottom, left
값 설정시, 부모 tag의 해당 property로 부터 설정한 값만큼 이동한다.position: fixed
top, right, bottom, left
값 설정시, 렌더링 화면에서 해당 property로 부터 설정한 값만큼 이동한다.