HTML 프로젝트 구조 설정
이 단계에서는 CSS 상대 위치 지정 (relative positioning) 을 배우기 위한 기본적인 HTML 프로젝트 구조를 설정합니다. 간단한 프로젝트 디렉토리를 생성하고 웹 레이아웃 실험에 필요한 파일을 초기화합니다.
먼저, 프로젝트 디렉토리로 이동합니다:
cd ~/project
CSS 위치 지정 프로젝트를 위한 새 디렉토리를 생성합니다:
mkdir css-positioning
cd css-positioning
이제 WebIDE 를 사용하여 기본 프로젝트 파일을 생성합니다:
index.html이라는 HTML 파일을 생성합니다:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>CSS Relative Positioning</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<div class="container">
<img src="left-image.jpg" alt="Left Image" class="left-image" />
<img src="right-image.jpg" alt="Right Image" class="right-image" />
</div>
</body>
</html>
- 프로젝트에 사용할 샘플 이미지를 다운로드합니다:
wget https://labex.io/sample-left-image.jpg -O left-image.jpg
wget https://labex.io/sample-right-image.jpg -O right-image.jpg
예시 출력:
--2024-xx-xx xx:xx:xx-- https://labex.io/sample-left-image.jpg
Resolving labex.io (labex.io)...
Downloading sample images...
이 설정은 이미지 자리 표시자가 있는 기본 HTML 구조를 생성하고, 다음 단계에서 CSS 위치 지정 실험을 위한 프로젝트를 준비합니다.