LAYOUT LAB / CANONICAL HTML + CSS

공간에 맞춰 바뀌는 그리드

Repeat items into as many useful columns as space allows.

720px

원문 CSS의 공간 배치를 실행합니다. 색·테두리는 영역 구분용이며, 비어 있던 미디어와 설정 슬롯에는 예시 콘텐츠를 채웠습니다.

실행한 HTML·CSS 코드
<section class="ram_grid" aria-label="Photo albums">
    <article>Spring launch album</article>
    <article>Customer meetup album</article>
    <article>Workshop album</article>
</section>

<style>
.ram_grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
}

</style>
원문 가이드