Sub topic 5
Choose one primary call to action
This chapter assumes you know basic HTML and CSS and have a value proposition and headline for your hero. Here you choose the single action the hero asks for and build it as a link or button.
Why a hero needs one primary action
The call to action (CTA) is the control that tells the visitor what to do next. A hero has a few seconds of attention. If it offers "Start free trial", "Book a demo", "See pricing" and "Watch video" at equal weight, the visitor has to compare four options before doing anything. Many leave instead.
Pick one primary CTA. It should be the action that moves the visitor closest to the outcome your value proposition promises. You can add a secondary action, but it must look quieter, such as a text link. It must not look like a second button of the same weight.
Label it with the outcome
A label like "Submit" or "Learn more" describes the mechanism, not the result. A strong label starts with a verb and names what the visitor gets or does.
| Weak label | Stronger label | Why |
|---|---|---|
| Submit | Start free trial | Says what happens after the click |
| Learn more | See how invoicing works | Names the topic |
| Click here | Get my invoice template | Names the thing received |
| Get started | Create your first invoice | Names the first step |
Keep the label to two to four words. Use the same wording on the page and on the page it links to, so the visitor feels they landed where they expected.
Add a short note under the button when it removes a common worry. The Ledgerly hero uses "No credit card required", which answers the objection a visitor has just before clicking.
Link or button?
Use the element that matches the behavior. If the CTA goes to another page, such as /signup, it is a link, so use <a>. If it runs JavaScript on the current page, such as opening a form, use <button>. A link styled like a button is fine. A <div> with a click handler is not, because it has no keyboard support or role.
<section class="hero" aria-labelledby="hero-title">
<h1 id="hero-title">Send invoices in under a minute</h1>
<p class="hero__sub">Ledgerly helps freelancers create, send and track invoices, so you get paid sooner.</p>
<a class="hero__cta" href="/signup">Start free trial</a>
<p class="hero__note">No credit card required</p>
<a class="hero__secondary" href="/pricing">See pricing</a>
</section>Style it so it stands out
The primary CTA should be the strongest filled shape in the hero. The secondary action stays a plain link. The text and background colors need enough contrast, and the target needs enough size to tap on a phone.
.hero__cta {
display: inline-block;
padding: 0.875rem 1.5rem;
min-height: 2.75rem;
background: #0b5fff;
color: #fff;
border-radius: 0.5rem;
font-weight: 600;
text-decoration: none;
}
.hero__cta:hover {
background: #0846c2;
}
.hero__cta:focus-visible {
outline: 3px solid #0b5fff;
outline-offset: 3px;
}
.hero__secondary {
margin-left: 1rem;
color: #0b5fff;
}The :focus-visible rule gives keyboard users a clear outline. Never remove the outline without replacing it.
Common errors
- Two equal buttons. Both look primary, so neither is. Demote one to a text link.
- A vague label. "Get started" with no object leaves the visitor guessing what starts.
- A mismatch with the offer. A headline about invoicing followed by a CTA to "Contact sales" breaks the promise.
- Low contrast or a small target. White text on a light blue fill is hard to read. A target under about 44 by 44 pixels is hard to tap.
- A CTA below the fold on mobile. On a phone, a tall image can push the button out of view. Check it at a narrow width.
Exercise
A hero for an accounting firm shows two equal blue buttons, "Book a consultation" and "Download our guide". Which should be the primary CTA, how would you change the other, and what label would you give the primary?
Show answer
Choose the action closest to the firm's offer, which is usually "Book a consultation". Make the guide a quieter text link or a lower-weight secondary control. Label the primary with the outcome, for example "Book a free consultation", and keep it as an <a> if it goes to a booking page.