헤더와 푸터를 1920으로 width를 잡고,
main 쪽을 width 100%로 잡는다.
header {
margin: auto;
width: 1920px;
display: flex;
align-items: center;
position: relative;
}
/* nav */
header > nav {
width: 100%;
height: 45px;
position: absolute;
bottom: 0;
}
main {
width : 100%;
min-height: 700px;
}
레이아웃 container 로 잡고 그 안에 헤더, 푸터 등 container를 하나씩 쌓기.
1) 보이는 큼직한 layout 잡기 (div태그로 박스 잡기)
2) 큼직한 박스 안에 있는 요소들의 width는 대부분 calc()나 퍼센트나 auto로 처리
3) window 줄어들 때 이 이상 줄어들지 마라 하는 최소 넓이, 높이 지정해주기! (min-width 속성)
window 늘어날 때 이 이상 늘어나지 마라 하는 최대 넓이, 높이 지정해주기! (max-width 속성)
4) display: flex 이용
5) 비율유지하면서 줄어들게 할 때는 padding-bottom 값 이용!
import reportWebVitals from './reportWebVitals';
reportWebVitals();
렌더링이 두번 된 것 같이 되어서 지우고 사용하는 것이 좋다.
<Route path="/" element=<Start />
근래 이렇게 작성하는 경우는 드물고, page 폴더를 따로 만들어서두는 것이 좋다.
- element
input , button 이런 요소들- component
작은 단위들을 나눔. section, article 별로.- page
라우팅 경로로 Login, Main, QR페이지 등