← Todos os snippets
Galeria estilo masonry (colunas)
Blocos de alturas diferentes encaixados em colunas, com CSS columns.
Preview ao vivo
Código completo
<style>*{box-sizing:border-box}body{font-family:system-ui,sans-serif;margin:0;padding:24px;background:#0e1013;color:#e8eaec;line-height:1.5}a{color:inherit;text-decoration:none}img{max-width:100%;display:block}
.g{columns:3 120px;column-gap:12px}.g div{break-inside:avoid;margin-bottom:12px;border-radius:12px}
</style>
<div class="g"><div style="height:120px;background:#2f6fed"></div><div style="height:80px;background:#7c3aed"></div><div style="height:150px;background:#e4572e"></div><div style="height:100px;background:#1f9c7a"></div><div style="height:70px;background:#f59e0b"></div><div style="height:130px;background:#db2777"></div></div>