HTML Formatterhtmlformatteronline.com

Call-to-action band

Four variants — split, centred, boxed and inline — for the end of a page.

sectionctaconversionband
<!-- 1. split -->
<section class="cta split">
  <div>
    <h2>Ready to deploy?</h2>
    <p>Put a site online in the time it takes to make coffee. No card needed.</p>
  </div>
  <a class="btn" href="/start/">Start building</a>
</section>

<!-- 2. centred, dark -->
<section class="cta centred dark">
  <h2>Stop maintaining the glue</h2>
  <p>One platform instead of four, and nothing between them to break.</p>
  <div class="pair">
    <a class="btn light" href="/start/">Get started free</a>
    <a class="btn quiet" href="/demo/">Book a walkthrough</a>
  </div>
  <p class="fine">Free for personal projects · Cancel any time</p>
</section>

<!-- 3. boxed with a border accent -->
<section class="cta boxed">
  <h2>Migrating from somewhere else?</h2>
  <p>We will move your first ten projects across at no cost, usually within a day.</p>
  <a class="btn" href="/migrate/">Talk to us about moving</a>
</section>

<!-- 4. inline, for the middle of an article -->
<aside class="cta inline">
  <p><strong>Related:</strong> this is easier with the CLI. <a href="/cli/">Read the two-minute setup →</a></p>
</aside>

How it works

Four variants for four positions on a page. The split band is for the end of a landing page, the dark centred one for a dedicated conversion moment, the boxed one for a specific offer, and the inline one for the middle of an article.

margin-left: auto rather than space-between. With justify-content: space-between the gap between the text and the button grows as the container widens, and on a long heading the button gets pushed off in an odd way. An auto margin keeps the text block intact and pushes only the button.

One action, or one action plus a quiet one. Two equally weighted buttons make people choose before they know enough, and the usual result is that they choose neither. The second button in the dark variant is deliberately outlined rather than filled.

The fine print goes under the buttons, not above. "No card needed" answers the objection someone has immediately after they have decided to click, which is where it does the most work.

Full-width buttons below 640 pixels. Two side-by-side buttons on a phone give you two cramped tap targets instead of one comfortable one.

The inline variant is an aside. It is tangentially related to the surrounding article, which is exactly what <aside> means. A <div> would render the same and say nothing.

Accessibility notes

Every action here is a link, because they navigate. Use a <button> only when something happens on the same page.

Check contrast on the quiet button in the dark variant: a white outline at 30 percent opacity is decorative, but the label on it must still clear 4.5:1 against the background behind it. White text on this gradient does.

Do not use a heading level just because the text looks like a heading. If the band sits inside an article, an <h2> may break the outline — match the level to where it sits in the document, not to its size.

Making it yours

The button label should describe what happens, not what the button is. "Start building" and "Book a walkthrough" beat "Submit" and "Click here", and they help screen reader users who pull up a list of links on the page.

The arrow in the inline variant is a literal character in the text rather than an icon, so it is copied with the link and needs no extra markup. Keep it out of the accessible name if you use a real icon — decorative arrows should be aria-hidden.

For the dark band, the gradient generator will build the radial wash. Keep it large and faint; a small strong gradient reads as a blob behind the text.

Related templates

Check your version

Once you have edited this, the HTML validator will catch any tag you left unclosed, and the formatter will tidy the indentation. Both run in your browser.