Component Library

← Back to gallery

Benefit-list call-to-action banner in HTML, CSS and vanilla JS

A copy-paste Benefit-list call-to-action banner in plain HTML and CSS, with vanilla JavaScript: no framework, no build step, MIT-licensed.

Category: Marketing · Tags: call-to-action, banner, conversion, landing, band

Live preview

Source (copy-ready)

<section class="dcl-cta-banner-benefit-footer-root" aria-label="Benefit-list call-to-action banner" data-dcl-scheme="light">
<h2>Prepare for an archive move</h2><ul class="dcl-cta-banner-benefit-footer-grid" role="list"><li><div class="dcl-cta-banner-benefit-footer-panel"><h3>Inventory</h3><p>Write down your current collections.</p></div></li>
<li><div class="dcl-cta-banner-benefit-footer-panel"><h3>Permissions</h3><p>Identify who should retain access.</p></div></li>
<li><div class="dcl-cta-banner-benefit-footer-panel"><h3>Recovery</h3><p>Pick a fallback location.</p></div></li></ul><div class="dcl-cta-banner-benefit-footer-border"><a href="#dcl-cta-banner-benefit-footer-destination">Open the archive move guide</a></div><div class="dcl-cta-banner-benefit-footer-panel" id="dcl-cta-banner-benefit-footer-destination"><h3>Archive move guide</h3><p>Start with a small, reversible trial collection.</p></div>
<script>
(() => {
  const root = document.currentScript.closest(".dcl-cta-banner-benefit-footer-root");
  const preference = matchMedia("(prefers-color-scheme: dark)");
  const apply = () => {
    root.dataset.dclScheme = document.documentElement.dataset.theme || (preference.matches ? "dark" : "light");
  };
  preference.addEventListener("change", apply);
  apply();

  const target = root.querySelector("[id]");
  const index = [...document.getElementsByClassName(root.className)].indexOf(root);
  const link = root.querySelector("a");
  if (index > 0) {
    target.id += "--" + index;
    link.setAttribute("href", "#" + target.id);
  }
  if (location.href === "about:srcdoc") link.addEventListener("click", (event) => {
    event.preventDefault();
    target.tabIndex = -1;
    target.focus();
  });

})();
</script>
</section>
<style>
.dcl-cta-banner-benefit-footer-root { color: #11292f; background-color: #ffffff; color-scheme: light; }
.dcl-cta-banner-benefit-footer-root .dcl-cta-banner-benefit-footer-panel, .dcl-cta-banner-benefit-footer-root .dcl-cta-banner-benefit-footer-badge,
.dcl-cta-banner-benefit-footer-root button, .dcl-cta-banner-benefit-footer-root input, .dcl-cta-banner-benefit-footer-root select, .dcl-cta-banner-benefit-footer-root summary {
  color: #11292f; background-color: #e4edef; border-color: #697f84;
}
.dcl-cta-banner-benefit-footer-root .dcl-cta-banner-benefit-footer-muted { color: #405a60; }
.dcl-cta-banner-benefit-footer-root button:hover, .dcl-cta-banner-benefit-footer-root button[aria-pressed="true"], .dcl-cta-banner-benefit-footer-root summary:hover {
  color: #ffffff; background-color: #00535a;
}
.dcl-cta-banner-benefit-footer-root a { color: #005c62; }
.dcl-cta-banner-benefit-footer-root :focus-visible { outline: 3px solid #005c62; outline-offset: 3px; }
.dcl-cta-banner-benefit-footer-root { --edge: #697f84; --accent: #00535a; }

.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] { color: #eff8f9; background-color: #142f36; color-scheme: dark; }
.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] .dcl-cta-banner-benefit-footer-panel, .dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] .dcl-cta-banner-benefit-footer-badge,
.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] button, .dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] input, .dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] select, .dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] summary {
  color: #eff8f9; background-color: #1c3c44; border-color: #839fa5;
}
.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] .dcl-cta-banner-benefit-footer-muted { color: #b0c9ce; }
.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] button:hover, .dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] button[aria-pressed="true"], .dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] summary:hover {
  color: #11292f; background-color: #8fe1da;
}
.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] a { color: #8fe1da; }
.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] :focus-visible { outline: 3px solid #8fe1da; outline-offset: 3px; }
.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] { --edge: #839fa5; --accent: #8fe1da; }

.dcl-cta-banner-benefit-footer-root { display: grid; gap: 1rem; box-sizing: border-box; max-inline-size: 60rem; margin-inline: auto; padding: clamp(0.875rem, 3vw, 2rem);
  border: 1px solid var(--edge); border-radius: 0.75rem; font: 1rem/1.55 system-ui, sans-serif; overflow-wrap: anywhere; }
.dcl-cta-banner-benefit-footer-root * { box-sizing: border-box; min-inline-size: 0; }
.dcl-cta-banner-benefit-footer-root h2, .dcl-cta-banner-benefit-footer-root h3, .dcl-cta-banner-benefit-footer-root p, .dcl-cta-banner-benefit-footer-root ul, .dcl-cta-banner-benefit-footer-root ol, .dcl-cta-banner-benefit-footer-root dl, .dcl-cta-banner-benefit-footer-root dd, .dcl-cta-banner-benefit-footer-root figure, .dcl-cta-banner-benefit-footer-root blockquote, .dcl-cta-banner-benefit-footer-root fieldset { margin: 0; }
.dcl-cta-banner-benefit-footer-root h2 { font-size: clamp(1.375rem, 3vw, 2rem); line-height: 1.18; }
.dcl-cta-banner-benefit-footer-root h3 { font-size: 1.125rem; line-height: 1.3; }
.dcl-cta-banner-benefit-footer-root ul, .dcl-cta-banner-benefit-footer-root ol { padding: 0; list-style: none; }
.dcl-cta-banner-benefit-footer-panel > * + *, .dcl-cta-banner-benefit-footer-disclosure > * + * { margin-block-start: 0.65rem; }
.dcl-cta-banner-benefit-footer-stack, .dcl-cta-banner-benefit-footer-grid, .dcl-cta-banner-benefit-footer-split, .dcl-cta-banner-benefit-footer-rail { display: grid; gap: 1rem; align-items: start; }
.dcl-cta-banner-benefit-footer-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.dcl-cta-banner-benefit-footer-split { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.dcl-cta-banner-benefit-footer-rail { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.dcl-cta-banner-benefit-footer-bar { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; }
.dcl-cta-banner-benefit-footer-spread { justify-content: space-between; }
.dcl-cta-banner-benefit-footer-panel { padding: 1rem; border: 1px solid var(--edge); border-radius: 0.625rem; }
.dcl-cta-banner-benefit-footer-badge { display: inline-block; width: fit-content; border: 1px solid var(--edge); border-radius: 1rem;
  padding: 0.16rem 0.65rem; font-size: 0.875rem; font-weight: 650; }
.dcl-cta-banner-benefit-footer-muted { font-size: 0.875rem; }
.dcl-cta-banner-benefit-footer-root button, .dcl-cta-banner-benefit-footer-root input, .dcl-cta-banner-benefit-footer-root select, .dcl-cta-banner-benefit-footer-root summary {
  font: inherit; padding: 0.45rem 0.7rem; border: 1px solid; border-radius: 0.375rem; max-inline-size: 100%; }
.dcl-cta-banner-benefit-footer-root input[type="checkbox"], .dcl-cta-banner-benefit-footer-root input[type="radio"] { inline-size: 1.15rem; block-size: 1.15rem; accent-color: var(--accent); }
.dcl-cta-banner-benefit-footer-root button, .dcl-cta-banner-benefit-footer-root select, .dcl-cta-banner-benefit-footer-root summary, .dcl-cta-banner-benefit-footer-root label { cursor: pointer; }
.dcl-cta-banner-benefit-footer-root button:disabled { cursor: not-allowed; border-style: dashed; }
.dcl-cta-banner-benefit-footer-root button:active, .dcl-cta-banner-benefit-footer-root summary:active { text-decoration: underline; }
.dcl-cta-banner-benefit-footer-root a { display: inline-block; padding: 0.2rem; text-underline-offset: 0.2em; }
.dcl-cta-banner-benefit-footer-root a:hover { text-decoration-thickness: 2px; }
.dcl-cta-banner-benefit-footer-root fieldset { padding: 0.75rem; border: 1px solid var(--edge); border-radius: 0.5rem; }
.dcl-cta-banner-benefit-footer-root legend { font-weight: 700; padding-inline: 0.35rem; }
.dcl-cta-banner-benefit-footer-scroll { overflow-x: auto; padding: 0.2rem; }
.dcl-cta-banner-benefit-footer-root table { border-collapse: collapse; inline-size: 100%; text-align: start; }
.dcl-cta-banner-benefit-footer-root caption { text-align: start; font-weight: 700; padding-block: 0.375rem; }
.dcl-cta-banner-benefit-footer-root td, .dcl-cta-banner-benefit-footer-root th { border-block-end: 1px solid var(--edge); padding: 0.5rem; text-align: start; }
.dcl-cta-banner-benefit-footer-root svg { display: block; max-inline-size: 100%; block-size: auto; }
.dcl-cta-banner-benefit-footer-border { border-inline-start: 0.25rem solid var(--accent); padding-inline-start: 0.875rem; }
.dcl-cta-banner-benefit-footer-center { text-align: center; justify-items: center; }
.dcl-cta-banner-benefit-footer-center svg { margin-inline: auto; }
.dcl-cta-banner-benefit-footer-root [hidden] { display: none; }
.dcl-cta-banner-benefit-footer-stack[hidden], .dcl-cta-banner-benefit-footer-bar[hidden] { display: none; }
@media (max-width: 34rem) { .dcl-cta-banner-benefit-footer-rail { grid-template-columns: minmax(0, 1fr); } }

.dcl-cta-banner-benefit-footer-root a { border-radius: 0.4rem; padding: 0.55rem 0.85rem; width: fit-content; font-weight: 700; }
.dcl-cta-banner-benefit-footer-root :target { outline: 2px solid var(--accent); outline-offset: 2px; }
.dcl-cta-banner-benefit-footer-root a { color: #ffffff; background-color: #00535a; }.dcl-cta-banner-benefit-footer-root a:hover { color: #ffffff; background-color: #003c42; }.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] a { color: #11292f; background-color: #8fe1da; }.dcl-cta-banner-benefit-footer-root[data-dcl-scheme="dark"] a:hover { color: #11292f; background-color: #b2f2ec; }
</style>

When to use

Use when a short list of concrete results helps visitors decide whether to open a guide. Replace the sample destination and action wording together.

Avoid

Do not add links to each benefit if the section is meant to have one clear next action.

Accessibility

The destination is a native link with visible focus and an explicit accessible name. The sample link jumps to its local destination. Theme token text pairs reach at least 6.2:1 in light and 6.8:1 in dark.

Was this useful? Send feedback.