[React + Chakra UI] root 아래 기본 html 뼈대 구조

2022. 12. 21. 20:06
반응형

기본 구조

<body>
  <div id="root>
    <div>        //1번 : 웹페이지 전체를 감싸는 div
      <nav />    //2번 : 상단네비바
      <main />   //3번 : 네비바 아래 콘텐츠 영역
    </div>
  </div>
</body>

 

1번: 웹페이지 전체를 감싸는 div

position: fixed;
inset: 0;
display: flex;
flex-direction: column;

 

2번: 상단 네비바

display: flex;
position: relative;
flex-shrink: 0;
justify-content:center;
align-items: center;
height: 48px;
background: tomato;
width: 100%;

 

 

3번: 네비바 아래 콘텐츠 영역

flex: 1 1 0%;
height: 100%;
overflow: auto;

 

 

 

반응형

BELATED ARTICLES

more