멀티 컬럼

Multi-column layout

신문처럼 텍스트를 여러 단으로 자동으로 흘려보내는 CSS 기능. `columns` 한 줄이면 끝입니다.

다른 이름: CSS columnsNewspaper columnscolumn-count
···
html
<div class="page">
  <div class="cols" id="cols">
    <p>Design systems turn scattered decisions into shared defaults. A spacing scale, a type ramp, a small set of named colors — none of it is exciting on its own, but together it removes hundreds of tiny arguments before they happen. Consistency compounds quietly over months.</p>
  </div>
  <div class="tag" id="tag">column-count: 1</div>
</div>
css
.page{display:flex;flex-direction:column;align-items:center;gap:10px;width:min(92%,460px)}
.cols{width:100%;height:min(70%,190px);overflow:hidden;column-gap:18px;column-rule:1px solid var(--line);
  transition:column-count .6s}
.cols p{margin:0;font-size:clamp(10px,1.9vmin,12px);line-height:1.55;color:var(--fg)}
.tag{font:700 clamp(9px,1.7vmin,11px)/1 ui-monospace,monospace;color:var(--accent-2);
  background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:4px 8px}
js
const cols = document.getElementById('cols');
const tag = document.getElementById('tag');
const counts = [1, 2, 3, 2];
let i = 0;
setInterval(() => {
  const n = counts[i % counts.length];
  cols.style.columnCount = String(n);
  tag.textContent = 'column-count: ' + n;
  i++;
}, 1700);

`column-count: 3`을 주면 브라우저가 안의 텍스트를 세 단으로 나눠서 위에서 아래로 채우고, 첫 단이 다 차면 다음 단으로 넘어갑니다. `column-width`를 대신 쓰면 컬럼 개수 대신 "각 단이 이 너비 이상이면 자동으로 단을 늘려라"는 식으로 반응형이 됩니다. 둘을 한 번에 `columns: 200px 3`처럼 줄 수도 있는데, 이때는 "최대 3단, 각 단은 최소 200px"라는 상한·하한 역할을 합니다.

단 사이 간격은 `column-gap`, 구분선은 `column-rule`(border와 문법이 같습니다)로 조절합니다. 이미지·카드처럼 중간에 잘리면 안 되는 요소에는 `break-inside: avoid`를 줘서 다음 단으로 통째로 넘어가게 만듭니다.

Grid·Flexbox와 다른 점은 "읽는 순서"입니다. 멀티 컬럼은 위→아래로 다 채운 뒤 다음 단으로 넘어가므로 세로로 긴 지그재그 순서가 되고, Grid의 auto-flow는 왼쪽→오른쪽으로 채웁니다. 그래서 멀티 컬럼은 순수 텍스트(기사, 사전 항목)에는 잘 맞지만, 카드처럼 항목 사이의 좌우 관계가 중요한 콘텐츠에는 맞지 않습니다.

언제 쓰나

긴 텍스트 기사, FAQ, 용어 사전처럼 "쭉 읽는" 콘텐츠에 씁니다. 카드·이미지 갤러리처럼 항목 단위로 다뤄야 하면 Grid나 메이슨리가 낫습니다.