test
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
body {
margin: 0;
padding: 2rem 0;
background: #f0f0f0;
font-family: sans-serif;
display: flex;
justify-content: center;
align-items: flex-start;
}
.a4-wrapper {
width: 100%;
max-width: 210mm; /* A4 너비 기준 */
aspect-ratio: 210 / 297; /* A4 비율 유지 */
}
.a4-container {
width: 100%;
height: auto;
padding-top: 141.428%; /* A4 비율 유지 (297/210 * 100%) */
position: relative;
background: white;
border: 1px solid #000;
box-sizing: border-box;
}
.header, .footer {
position: absolute;
left: 0;
width: 100%;
height: 10mm;
display: flex;
align-items: center;
padding: 0 10px;
font-size: 12px;
color: #666;
box-sizing: border-box;
}
.header {
top: 0;
border-bottom: 1px dashed #aaa;
}
.footer {
bottom: 0;
border-top: 1px dashed #aaa;
}
.content {
position: absolute;
top: 10mm;
bottom: 10mm;
left: 0;
right: 0;
padding: 10mm;
box-sizing: border-box;
overflow: hidden;
}
@media print {
body {
background: white;
}
.a4-wrapper {
max-width: none;
width: 210mm;
}
}
</style>
</head>
<body>
<div class="a4-wrapper">
<div class="a4-container">
<div class="header">머리글 영역 (예: 제목)</div>
<div class="content">
<p>본문 콘텐츠 영역입니다. 이미지, 텍스트 등을 넣을 수 있어요.</p>
</div>
<div class="footer">꼬리글 영역 (예: 페이지 번호)</div>
</div>
</div>
</body>
</html>
by eGrida posted May 05, 2025