HTML 프로젝트 구조 설정
이 단계에서는 고정 위치 지정 레이아웃 데모를 위한 프로젝트 구조를 생성합니다. CSS 위치 지정 연습의 기반이 될 ~/project 디렉토리에 간단한 HTML 프로젝트를 설정합니다.
먼저, 프로젝트 디렉토리로 이동하여 필요한 파일을 생성합니다.
cd ~/project
mkdir fixed-positioning-demo
cd fixed-positioning-demo
이제 기본 HTML 파일 구조를 생성합니다.
touch index.html
touch styles.css
index.html 파일을 열고 다음 기본 HTML 구조를 추가합니다.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Fixed Positioning Layout Demo</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="content">
<h1>Fixed Positioning Layout</h1>
<p>This is a sample page to demonstrate fixed positioning in CSS.</p>
<!-- We'll add more content in subsequent steps -->
</div>
</body>
</html>
기본 CSS 파일 styles.css를 생성하고 초기 스타일을 추가합니다.
body {
font-family: Arial, sans-serif;
line-height: 1.6;
margin: 0;
padding: 0;
}
.content {
max-width: 800px;
margin: 0 auto;
padding: 20px;
}
예시 출력 구조:
~/project/fixed-positioning-demo/
├── index.html
└── styles.css
이 설정은 고정 위치 지정 기술을 시연하기 위해 다음 단계에서 구축할 깨끗하고 간단한 프로젝트 구조를 제공합니다.