안녕하세요! 웹스토리보이입니다 😊
이번에는 E-4 유형 레이아웃을 함께 만들어보겠습니다. E유형은 웹디자인기능사 실기 시험에서 구조적으로 가장 복잡한 유형 중 하나입니다.
다양한 콘텐츠 구성이 들어가고, 각 영역의 너비와 높이도 다양하게 설정되어 있어 초반에는 조금 헷갈릴 수 있어요. 하지만 걱정하지 마세요! 지금까지 A~E-3 유형까지 연습해오셨다면, 이미 레이아웃의 흐름과 방식은 충분히 익숙하실 거예요. E-4 유형 역시 핵심은 반복 연습과 구조 파악입니다. 자, 그럼 복잡함 속에서 규칙을 찾아가는 즐거움! 같이 도전해볼까요? 렛츠 기릿! 💪✨
VSCODE를 실행하고 webdesign 폴더 안에 layoutE-4.html파일을 만들겠습니다.
!를 치고 tab버튼을 누르면 다음과 같이 나타납니다. lang는 ko로 변경하고 title은 웹디자인개발기능사 레이아웃 E-4으로 변경해주겠습니다.
1<!DOCTYPE html>
2<html lang="ko">
3<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>웹디자인개발기능사 레이아웃 E-4</title>
7</head>
8<body>
9
10</body>
11</html>
main과 footer로 이루어진 2단구조로 먼저 작업을 하겠습니다. 화면 높이 값에 맞게 height 값을 설정해야 함으로 main의 높이 값은 height: calc(100vh - 120px);로 설정하겠습니다.
1<body>
2 <div id="wrap">
3 <main id="main"></main>
4 <footer id="footer"></footer>
5 </div>
6</body>
1 * {
2 margin: 0;
3 padding: 0;
4}
5#wrap {
6 width: 100%;
7}
8#main {
9 width: 100%;
10 height: calc(100vh - 120px);
11 background-color: #efefef;
12}
13#footer {
14 width: 100%;
15 height: 120px;
16 background-color: #e3e3e3;
17}
메인 콘텐츠는 3개의 영역으로 이루어져 있으며, header, contents, slider로 구성하였습니다. 여기서 헤더와 콘텐츠는 고정값이고, 슬라이드는 유동적이기 때문에 width: calc(100% - 600px); 이렇게 설정해야 반응형이 가능합니다. 이렇게 하면 화면의 크기를 변경해도 화면에 맞게 변하는 모습을 볼 수 있습니다.
1<div id="wrap">
2 <main id="main">
3 <header id="header"></header>
4 <section id="contents"></section>
5 <article id="slider"></article>
6 </main>
7 <footer id="footer"></footer>
8</div>
1* {
2 margin: 0;
3 padding: 0;
4}
5#wrap {
6 width: 100%;
7}
8#main {
9 width: 100%;
10 height: calc(100vh - 120px);
11 display: flex;
12}
13#header {
14 width: 200px;
15 height: 100%;
16 background-color: #efefef;
17}
18#contents {
19 width: 400px;
20 height: 100%;
21 background-color: #e3e3e3;
22}
23#slider {
24 width: calc(100% - 600px);
25 height: 100%;
26 background-color: #d9d9d9;
27}
28#footer {
29 width: 100%;
30 height: 120px;
31 background-color: #d1d1d1;
32}
메인 박스 안에 헤더 영역을 작업하겠습니다. 헤더 영역은 로고와 메뉴 영역으로 나누어져 있습니다.
1<header id="header">
2 <h1></h1>
3 <nav></nav>
4</header>
5<!-- //header -->
1#header {
2 width: 200px;
3 height: 100%;
4}
5#header h1 {
6 width: 100%;
7 height: 10%;
8 background-color: #efefef;
9}
10#header nav {
11 width: 100%;
12 height: 90%;
13 background-color: #e3e3e3;
14}
컨텐츠 영역은 4개의 영역으로 이루어져 있습니다. 배너, 공지사항, 갤러리, 링크 영역으로 이루어져 있으며, 높이 값은 화면 비율에 맞추어야 하기 때문에 %로 작업하였습니다.
1<section id="contents">
2 <article class="banner"></article>
3 <article class="notice"></article>
4 <article class="gallery"></article>
5 <article class="link"></article>
6</section>
7<!-- //contents -->
1#contents {
2 width: 400px;
3 height: 100%;
4}
5#contents .banner {
6 width: 100%;
7 height: 15%;
8 background-color: #d9d9d9;
9}
10#contents .notice {
11 width: 100%;
12 height: 35%;
13 background-color: #d1d1d1;
14}
15#contents .gallery {
16 width: 100%;
17 height: 35%;
18 background-color: #c7c7c7;
19}
20#contents .link {
21 width: 100%;
22 height: 15%;
23 background-color: #bcbcbc;
24}
슬라이드 영역은 특별한 것이 없으니 영역만 잡고 넘어가겠습니다. 대신 width 값은 유동적으로 변해야 하기 때문에 width: calc(100% - 600px) 이렇게 설정했습니다.
1<article id="slider"></article>
1#slider {
2 width: calc(100% - 600px);
3 height: 100%;
4 background-color: #b1b1b1;
5}
푸터 영역은 3개의 영역으로 나누고, 두번재 영역은 다시 두개의 영역으로 작업하겠습니다.
1<footer id="footer">
2 <div class="footer1"></div>
3 <div class="footer2">
4 <div class="footer2-1"></div>
5 <div class="footer2-2"></div>
6 </div>
7 <div class="footer3"></div>
8</footer>
9<!-- //footer -->
1#footer {
2 width: 100%;
3 height: 120px;
4 display: flex;
5}
6#footer .footer1 {
7 width: 200px;
8 height: 120px;
9 background-color: #a3a3a3;
10}
11#footer .footer2 {
12 width: calc(100% - 500px);
13}
14#footer .footer2 .footer2-1 {
15 width: 100%;
16 height: 60px;
17 background-color: #9d9d9d;
18}
19#footer .footer2 .footer2-2 {
20 width: 100%;
21 height: 60px;
22 background-color: #929292;
23}
24#footer .footer3 {
25 width: 300px;
26 height: 120px;
27 background-color: #838383;
28}
<main>
: 전체 콘텐츠를 감싸는 영역. header, contents, slider를 포함합니다.<header>
: 로고와 내비게이션을 포함한 왼쪽 고정 메뉴 영역입니다.<section>
: 콘텐츠 영역으로 배너, 공지사항, 갤러리, 링크로 구성됩니다.<article>
: 슬라이드 영역과 콘텐츠 내부 블록들에 사용됩니다.<footer>
: 3분할 + 중첩 구조로 되어 있는 사이트 하단입니다.height: calc(100vh - 120px)
→ 전체 화면 높이에서 푸터 높이를 뺀 값을 메인 영역에 지정합니다.width: calc(100% - 600px)
→ 고정된 header(200px) + contents(400px)를 제외한 슬라이드 영역을 유동적으로 만듭니다.height: 퍼센트(%)
→ 콘텐츠 영역 내부는 비율 기반으로 높이를 설정하여 유연하게 구성됩니다.background-color
→ 구조 파악과 디버깅을 위한 임시 색상으로 각 영역을 구분합니다.display: flex
→ #main
과 #footer
에 적용되어 가로 정렬을 구현합니다.flex-direction
→ 기본값 row
로 좌우 영역 정렬. 필요 시 column
도 사용 가능justify-content
, align-items
→ 주축 및 교차축 정렬 시 사용됩니다.이제 E-4 유형까지 모두 완성하셨습니다 🎉 처음에는 복잡해 보일 수 있지만, 전체 레이아웃 흐름 → 각 섹션 구성 → 세부 스타일 적용이라는 틀로 접근하면 어렵지 않게 해결할 수 있습니다.
그럼 다음 유형에서도 다시 만나요! 고생 많으셨습니다 😎💯