- position : sticiky, top:0 을 통해 항상 위에 붙어있게 할 수 있고
- z-index : 1 을 통해 항상 가장 앞에 있는 요소로 고정시킬 수 있다.!!
const Container = styled.header`
display: flex;
justify-content: center;
align-items: center;
padding: 10px;
border-bottom: 2px solid ${COLORS.PRIMARY};
min-width: ${SIZES.HEADER_MIN_WIDTH};
position: sticky;
top: 0;
background-color: white;
z-index: 1;
`;
'React' 카테고리의 다른 글
접근 제한 라우팅(Access Control & Authentication) (0) | 2022.02.28 |
---|---|
Oauth (0) | 2022.02.28 |
[CSS] Flexbox (0) | 2022.02.15 |
[ReactHooks] 3. useEffect (0) | 2022.02.03 |
[ReactHooks] 1. useState (0) | 2022.02.02 |