test 1-2 11

<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>Spread Layout with Perfect Square Photos</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="https://cdn.jsdelivr.net/npm/lightbox2@2.11.4/dist/css/lightbox.min.css" rel="stylesheet" /> <style> :root { --a5-width: 420px; --a5-height: 595px; --square: 297.5px; /* 50% of A5 height */ } body { margin: 0; padding: 40px 0; background: #f2f2f2; font-family: sans-serif; display: flex; justify-content: center; } .spread { display: flex; width: calc(var(--a5-width) * 2); height: var(--a5-height); background-image: url('/files/attach/images/2025/04/30/ea837362da02d633b8b0168375e79183.jpg'); background-size: cover; background-position: center; box-shadow: 0 0 8px rgba(0,0,0,0.2); border: 1px solid #ccc; } .page { width: 50%; height: 100%; position: relative; overflow: hidden; } .page-left { clip-path: inset(0 50% 0 0); } .page-right { clip-path: inset(0 0 0 50%); } .photo-square { position: absolute; width: var(--square); height: var(--square); left: 0; overflow: hidden; z-index: 1; } .photo-square img { width: 100%; height: 100%; object-fit: cover; display: block; } .photo-square.top { top: 0; } .photo-square.bottom { top: var(--square); } .photo-right { position: absolute; top: 50%; left: 50%; transform: translate(-40%, -50%); width: 70%; max-height: 80%; z-index: 1; overflow: hidden; box-shadow: 0 0 4px rgba(0,0,0,0.2); } .photo-right img { width: 100%; height: 100%; object-fit: cover; } /* 모바일 대응 */ @media (max-width: 899px) { .spread { flex-direction: column; width: var(--a5-width); height: auto; background-position: center top; } .page { width: 100%; height: var(--a5-height); clip-path: none; } .photo-square { left: 10%; } .photo-right { left: 50%; transform: translate(-50%, -50%); } } /* 인쇄 대응 */ @media print { body { background: white; padding: 0; } .spread { width: 296mm; height: 210mm; background-size: cover; page-break-after: always; border: none; box-shadow: none; } .page { width: 148mm; height: 210mm; clip-path: none; } } </style> </head> <body> <div class="spread"> <!-- Page 1 (Left) --> <div class="page page-left"> <a href="/files/attach/images/2025/04/30/0493a3f881d83c0263211d06af551990.jpg" data-lightbox="album" data-title="Top Photo"> <div class="photo-square top"> <img src="/files/attach/images/2025/04/30/0493a3f881d83c0263211d06af551990.jpg" alt="Top Photo"> </div> </a> <a href="/files/attach/images/2025/04/30/aed9d0c3fbcc3bd8a5a1e2070ce3fcaf.jpg" data-lightbox="album" data-title="Bottom Photo"> <div class="photo-square bottom"> <img src="/files/attach/images/2025/04/30/aed9d0c3fbcc3bd8a5a1e2070ce3fcaf.jpg" alt="Bottom Photo"> </div> </a> </div> <!-- Page 2 (Right) --> <div class="page page-right"> <a href="/files/attach/images/2025/04/30/ea837362da02d633b8b0168375e79183.jpg" data-lightbox="album" data-title="Right Page Photo"> <div class="photo-right"> <img src="/files/attach/images/2025/04/30/ea837362da02d633b8b0168375e79183.jpg" alt="Right Photo"> </div> </a> </div> </div> <script src="https://cdn.jsdelivr.net/npm/lightbox2@2.11.4/dist/js/lightbox.min.js"></script> </body> </html>
by eGrida posted May 10, 2025
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄
Extra Form
Spread Layout with Perfect Square Photos

Articles