experiment_id: web-retrieval-v1
fixture_id: /demos/web-component-grid-caption-with-styling
mode: provenance
representation: html
origin_response_id: fe6f7cae614420ee98e93f7275897d04
version: 2026-10-21
version_created_at_utc: 2026-10-21T20:42:35.539Z
version_nonce: 6b32cfe46b8f1c0a98c5b061efe8440f
generated_at_utc: 2026-11-13T00:45:16.134Z
response_nonce: 966734f951608e4fe393b50d7cdd44e1

Caption with Custom Styling

115 of 125
Captions are fully styleable through CSS and CSS variables.
Result Full HTML CSS JS
Edit Download
Best Dogs

Full Code

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>ZingGrid Demo</title>
  <script nonce="undefined" src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
  <style>
    body {
      background: #e6e6e6;
    }

    zing-grid {
      --zg-caption-border: 15px solid #A1887F;
      --zg-caption-font-style: italic;
      --zg-caption-title-transform: rotate(-1deg);
      --zg-caption-font-weight: bold;
      --zg-caption-font-family: 'Comic Sans MS', sans-serif;
      --zg-caption-color: #455A64;
      --zg-caption-background: #AED581;
      --zg-caption-background: radial-gradient(#FCF3CF, #AED581);
    }

    zg-caption:hover {
      opacity: 0.5;
      transition: all 1s ease;
    }

    zing-grid[loading] {
      height: 307px;
    }
  </style>
</head>

<body>
  <zing-grid>
    <zg-caption align="center">Best Dogs</zg-caption>
    <zg-data data='[{"name": "Oreo","breed":"Mastiff"}, {"name": "Buddy","breed":"Great Dane"}, {"name": "Max","breed":"Doodle"}]'>
    </zg-data>
  </zing-grid>
  <script>
    ZingGrid.setLicense(['26ccbfec16b8be9ee98c7d57bee6e498']);
  </script>
</body>

</html>
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>ZingGrid Demo</title>
    <script src="https://cdn.zinggrid.com/zinggrid.min.js"></script>
  </head>
  <body>
     <zing-grid>
       <zg-caption align="center">Best Dogs</zg-caption>
   		<zg-data data='[{"name": "Oreo","breed":"Mastiff"}, {"name": "Buddy","breed":"Great Dane"}, {"name": "Max","breed":"Doodle"}]'>
      </zg-data>
    </zing-grid>
	</body>
</html>
body{background:#e6e6e6;}

zing-grid {
	--zg-caption-border: 15px solid #A1887F;
  --zg-caption-font-style: italic;
  --zg-caption-title-transform: rotate(-1deg);
  --zg-caption-font-weight: bold;
  --zg-caption-font-family: 'Comic Sans MS', sans-serif;
  --zg-caption-color: #455A64;
  --zg-caption-background: #AED581;
  --zg-caption-background: radial-gradient(#FCF3CF, #AED581);
}

zg-caption:hover {
  opacity: 0.5;
  transition: all 1s ease;
}
// No JS code

Interested in this demo? Modify it to your needs in ZingSoft Studio, our testing sandbox. It's free to sign up, and you can come back and edit at any time!

Edit in Studio

Demo Gallery