LAYOUT / 066

Spanning grid

大小を組み合わせるグリッド
一部の要素を複数の行や列にまたがって配置します。

実際のHTML・CSSで描かれた見本です。

ラボで詳しく試す ↗

ひとつ試すなら

大きさの違いで視線を誘導する

こんなときに

情報の大きさに強弱をつけるカード構成。

仕組みと使い方

見た目の配置を変えても、読む順序は自然に保ちます。

bento弁当大小gridカード
実装コードを見る
<style>
.sample{width:100%;height:100%;min-height:190px;display:grid;place-items:center;position:relative;overflow:hidden;box-sizing:border-box;font-family:Arial,'Hiragino Kaku Gothic ProN',Meiryo,sans-serif;color:#20211d;background:#f1f0e9;padding:22px}.sample *{box-sizing:border-box}.sample button,.sample input,.sample summary{font:inherit}.sample button,.sample summary,.sample label{touch-action:manipulation}.sample :focus-visible{outline:3px solid #6050bf;outline-offset:5px}.sample small{font-size:10px;line-height:1.5}.sample .editable{margin:0}.sample svg{max-width:100%;height:auto}
.sample .bento{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,60px);gap:8px;width:230px}.sample i:first-child{grid-row:span 2}.sample i:last-child{grid-column:span 2}.sample i{font-style:normal;display:grid;place-items:center;background:var(--accent,#c9f537);border-radius:5px;font-size:16px;font-weight:700;min-width:0}.sample i:nth-child(2n){background:#b9a9e8}.sample i:nth-child(3n){background:#ff865d}
</style>
<div class="sample">
<div class="bento"><i>A</i><i>B</i><i>C</i><i>D</i></div>
</div>