안녕하세요! 웹스토리보이입니다 😊
이번에는 C-3 유형 레이아웃을 함께 만들어보겠습니다. 기존에 작업했던 C유형들과 구조가 비슷하기 때문에, 이번에도 빠르게 실습하며 복습하는 느낌으로 진행해보겠습니다. 기초 레이아웃 흐름이 익숙해졌다면, 이번 유형은 훨씬 수월하게 느껴지실 거예요! 그럼 바로 시작해볼까요? 렛츠 고! 💪
VSCODE를 실행하고 webdesign폴더 안에 layoutC-3.html파일을 만들겠습니다.
!를 치고 tab버튼을 누르면 다음과 같이 나타납니다. lang는 ko로 변경하고 title은 웹디자인개발기능사 레이아웃 C-3으로 변경해주겠습니다.
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>웹디자인개발기능사 레이아웃 C-3</title>
</head>
<body>
</body>
</html>
전체적인 구조는 왼쪽 메뉴와 콘텐츠로 구성되어 있습니다. aside와 main 영역으로 설정하겠습니다. 전체 크기는 1000px로 설정하겠습니다.
<body>
<div id="wrap">
<aside id="aside"></aside>
<main id="main"></main>
</div>
<!-- //wrap -->
</body>
* {
margin: 0;
padding: 0;
}
#wrap {
width: 1000px;
display: flex;
}
#aside {
width: 20%;
height: 650px;
background-color: #efefef;
}
#main {
width: 80%;
height: 650px;
background-color: #e3e3e3;
}
콘텐츠 구조에는 3개의 섹션이 들어가기 때문에 이 부분도 구조화 하겠습니다. 이렇게 하면 전체적인 구조가 완성된것 같습니다. 세부적으로 하나씩 작업을 들어가겠습니다.
<div id="wrap">
<aside id="aside"></aside>
<main id="main">
<article id="slider"></article>
<section id="contents"></section>
<footer id="footer"></footer>
</main>
</div>
<!-- //wrap -->
#slider {
width: 100%;
height: 350px;
background-color: #d9d9d9;
}
#contents {
width: 100%;
height: 200px;
background-color: #d1d1d1;
}
#footer {
width: 100%;
height: 100px;
background-color: #c7c7c7;
}
왼쪽 사이드 영역에는 두개의 영역이 들어갑니다. width, height, background-color를 넣어주고, 영역을 확인하겠습니다.
<aside id="aside">
<h1></h1>
<nav></nav>
</aside>
<!-- //aside -->
#aside {
width: 20%;
}
#aside h1 {
width: 100%;
height: 100px;
background-color: #d9d9d9;
}
#aside nav {
width: 100%;
height: 550px;
background-color: #d1d1d1;
}
슬라이드 영역은 별개 없으니 영역만 확인하고 넘어가겠습니다.
<article id="slider"></article>
<!-- //slider -->
#slider {
width: 100%;
height: 350px;
background-color: #c7c7c7;
}
컨텐츠 영역에는 3개의 섹션으로 구성되어 있습니다. 독립적인 주제 영역이라면, article 태그를 사용해도 괜찮습니다.
<section id="contents">
<article class="content1"></article>
<article class="content2"></article>
<article class="content3"></article>
</section>
<!-- //contents -->
#contents {
width: 100%;
display: flex;
}
#contents .content1 {
width: 33.3333%;
height: 200px;
background-color: #bcbcbc;
}
#contents .content2 {
width: 33.3333%;
height: 200px;
background-color: #b1b1b1;
}
#contents .content3 {
width: 33.3333%;
height: 200px;
background-color: #a3a3a3;
}
푸터 영역은 두개의 영역으로 나누고, 두번째 영역은 다시 두개의 영역을 만들겠습니다.
<footer id="footer">
<div class="footer1"></div>
<div class="footer2">
<div class="footer2-1"></div>
<div class="footer2-2"></div>
</div>
</footer>
#footer {
width: 100%;
display: flex;
}
#footer .footer1 {
width: 20%;
background-color: #838383;
}
#footer .footer2 {
width: 80%;
}
#footer .footer2 .footer2-1 {
width: 100%;
height: 50px;
background-color: #9d9d9d;
}
#footer .footer2 .footer2-2 {
width: 100%;
height: 50px;
background-color: #929292;
}
<aside> : 좌측 고정 메뉴에 사용되는 보조 콘텐츠 영역.<main> : 주요 콘텐츠를 감싸는 중앙 영역.<article> : 독립적인 콘텐츠 블록에 사용 (슬라이드 등).<section> : 관련 콘텐츠 그룹을 묶는 용도.<footer> : 사이트 하단 정보를 포함하는 영역.display: flex → 수평 정렬을 위해 #wrap, #contents, #footer 등에 적용.width, height → 각 박스의 크기를 설정하여 레이아웃 구조 구분.background-color → 시각적으로 구조를 확인하기 위해 각 박스에 배경색 지정.#aside와 #main으로 수평 구조를 잡고, 내부 콘텐츠를 명확하게 분할했습니다.C-3 유형까지 정말 잘 따라오셨습니다! 🎉 반복되는 구조 속에서도 박스 배치 방식, 선택자 적용, 레이아웃 분할의 개념이 점점 더 자연스럽게 체득되고 있을 거예요.
이제 곧 D유형으로 넘어가면, 조금 더 다양한 변형 구조나 레이아웃 응용이 나올 예정입니다. 그 전에 C유형을 한 번 더 복습하고 넘어가도 좋아요!
그럼 다음 단계에서도 계속 함께 달려보아요! 수고하셨습니다 😊