Snippets Grid

CSS Grid Mask Poster Layout with Bootstrap 5

An editorial poster layout where a grid of solid tiles covers a full-bleed photo and the empty cells act as windows onto it.

Bootstrap 5 No jQuery Jan 2020 2.7K views

<section class="wdw-stage">
  <div class="container" style="max-width: 960px">
    <div class="text-center mb-3">
      <span class="wdw-eyebrow">CSS Grid</span>
      <h2 class="wdw-heading h3 mb-1">Grid as a mask</h2>
      <p class="wdw-muted mb-0">Solid cells cover a full-bleed photo. Cells left empty become windows.</p>
    </div>
    <figure class="gm-poster wdw-card mb-0">
      <div class="gm-photo" role="img" aria-label="Night mountain landscape with stars, visible through the poster windows"></div>
      <div class="gm-grid" id="gm-grid">
        <span class="gm-win gm-w1" aria-hidden="true"></span>
        <span class="gm-win gm-w2" aria-hidden="true"></span>
        <span class="gm-win gm-w3" aria-hidden="true"></span>
        <span class="gm-win gm-w4" aria-hidden="true"></span>
        <span class="gm-win gm-w5" aria-hidden="true"></span>
        <p class="gm-cap gm-cap1">An editorial poster built on an 8-column grid. Every tile is a plain element.</p>
        <p class="gm-name wdw-aurora"><span>Ada</span>Rivers</p>
        <p class="gm-cap gm-cap2">Remove a cell's background and the photo shows through.</p>
      </div>
    </figure>
  </div>
</section>

Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.

Free to use in personal and commercial projects under the MIT license.