CSS position 속성 relative, absolute, fixed, sticky 비교
position 속성에 대한 지식은 absolute에서 멈춰져 있던 상황. absolute의 기준점이 상위의 relative를 통해 정해지고 아니면 root 요소라는 것. fixed는 그냥 absolute로 해결이 안되면 사용하는게 전부. sticky 사용해보고 잘되면 사용 안되면 될 때까지 삽질. 이번에도 sticky를 사용하며 결국 기술부채를 해결하기로 했다. 그래서 absolute, fixed, sticky는 어떻게 다른가 static default 값 normal page flow를 따른다. left, right, top, bottom, z-index 은 영향을 주지 못한다. static 끼리는 나중 선언된 요소가 위로 올라온다.(z-index 가 적용되지 않기 때문에) static 의 z-ind..
기술이 된 상상
2023. 3. 2. 01:18