ScreenshotNeo

BlogGuides

What Is a Website Banner and How Do You Use One?

Learn what website banners mean, how to design and code them, choose responsive sizes, and keep them accessible.

By the ScreenshotNeo team1 October 20269 min read

Direct answer: A website banner is a prominent area that communicates an important message or action. In practice, the phrase can mean three different things: a homepage hero or promotional component, the semantic banner landmark for a site-wide header, or a government identification banner. Decide which meaning you need before choosing content, dimensions, markup, and accessibility behavior.

What “website banner” can mean

1. A homepage hero or message component

This is the visual banner most people mean: a large area near the top of a page containing a heading, short description, visual, and sometimes a button. California Web Standards describes this pattern as an attention-catching homepage element that can span the viewport or a content area. Use it to focus attention on one important message or next step.

2. The ARIA banner landmark

An ARIA banner is a semantic landmark for repeating site-wide header content such as identity, a logo, search, and global navigation. A top-level HTML <header> usually has this implicit meaning when it is not nested inside sectioning content. MDN recommends generally having one banner landmark per page context; do not give every decorative marketing panel role="banner". See MDN’s banner role reference.

3. A government identification banner

The U.S. Web Design System banner is a specialized component that helps visitors recognize official U.S. government websites and understand .gov/.mil and HTTPS indicators. It is not a generic hero pattern and should not be copied onto an ordinary commercial domain. See the USWDS banner guidance.

A banner advertisement is a separate category. Ad dimensions and placement come from the specific advertising platform, so do not apply hero-banner dimensions to an ad slot.

How to use a homepage banner

  1. Choose one primary purpose. Promote a launch, explain a key benefit, guide visitors to a task, or communicate a time-sensitive message.
  2. Write a short headline. State the value or information immediately. Keep supporting copy to one or two concise sentences.
  3. Add one primary action when it helps. Use a specific label such as “View pricing” or “Start a free trial.” Remove the button if the banner is informational.
  4. Choose a supporting visual. The image should reinforce the message, leave calm space behind text, and remain understandable when cropped.
  5. Place it near the top of the relevant page. A homepage commonly has one hero. Do not stack several competing hero banners.
  6. Link detailed explanations elsewhere. A banner is not a good location for a long block of product or policy copy.

California’s banner pattern recommends one hero, no more than one primary call to action, and avoiding carousels or crowded layouts. Treat those as useful design guidance rather than a universal law for every site.

  • One clear message that can be understood without reading the rest of the page.
  • A heading with a useful information scent, rather than a vague slogan.
  • Short supporting text that explains context or benefit.
  • One visible action at most when an action advances the user’s task.
  • HTML text for every meaningful word.
  • Decorative imagery marked appropriately so it does not interrupt screen-reader output.
  • A visible focus state and a keyboard-operable link or button.
  • Enough contrast between text and its background in every crop and theme.

Responsive banner sizing and aspect ratios

There is no universal website-banner pixel size. Your CMS, theme, design system, or ad platform may define a required crop. Preview the component at narrow and wide viewports because mobile layouts often stack the image and text or change their order.

Guidance How to use it
California Web Standards Its pattern lists a minimum image size of 776 × 517 pixels and a 1600-pixel minimum width for its full-span example. These values apply to that implementation, not every banner.
European Commission component library Its variants use 3:1 (large), 4:1 (medium), and 5:1 (small) aspect ratios. These are component-specific ratios.
Your own system Follow the documented crop, focal point, and maximum file size. Export a sufficiently large source for high-density screens, then serve responsive derivatives.

Use CSS rather than baking text into the image. Set a predictable minimum height, let the content determine height on small screens, and use object-fit: cover only when the focal point remains visible. Test long translations, browser zoom, and very narrow widths.

Accessible banner markup

Meaningful words must be actual HTML. The United Nations web guidance warns that text placed only in a banner image cannot be read by a screen reader or search engine and disappears when images are disabled. Follow WCAG 2.2 for broader requirements, then combine automated checks with manual keyboard and screen-reader review.

<header class="site-header">
  <a class="brand" href="/">Example site</a>
  <nav aria-label="Primary">
    <a href="/products">Products</a>
    <a href="/docs">Docs</a>
  </nav>
</header>

<main>
  <section class="hero" aria-labelledby="hero-title">
    <div class="hero__copy">
      <p class="eyebrow">New release</p>
      <h1 id="hero-title">Ship your next project with confidence</h1>
      <p>A short sentence explains what the visitor can do next.</p>
      <a class="button" href="/get-started">Get started</a>
    </div>
    <img src="/images/hero.webp" alt="A team reviewing a project timeline">
  </section>
</main>
:root {
  color-scheme: light dark;
  --ink: #15202b;
  --surface: #eef4ff;
  --accent: #155eef;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.9fr);
  gap: clamp(1.5rem, 4vw, 5rem);
  align-items: center;
  max-width: 75rem;
  margin-inline: auto;
  padding: clamp(2rem, 7vw, 7rem) clamp(1rem, 4vw, 4rem);
  background: var(--surface);
  color: var(--ink);
}

.hero img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 1rem;
}

.button {
  display: inline-block;
  padding: .75rem 1rem;
  border-radius: .5rem;
  background: var(--accent);
  color: white;
  text-decoration: none;
}

.button:focus-visible,
a:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

@media (max-width: 48rem) {
  .hero { grid-template-columns: 1fr; }
  .hero__copy { order: 1; }
  .hero img { order: 2; }
}

Do not put essential text inside the image

Use the image for atmosphere, product context, or visual hierarchy. Keep the heading, description, and action in HTML so they remain searchable, translatable, zoomable, and available when images fail. If an image is purely decorative, use an empty alt attribute; if it conveys information, describe that information briefly.

Testing a banner before publishing

  1. Resize from a wide desktop viewport to a narrow phone viewport and check every line break.
  2. Zoom to 200% and confirm no text or action is clipped.
  3. Navigate with Tab and Shift+Tab. Focus must be visible and the order must make sense.
  4. Turn images off or simulate a failed image request. The message and action should still work.
  5. Run an automated accessibility scan, then review with a screen reader such as VoiceOver or NVDA.
  6. Check contrast in light and dark themes, including text over the least favorable image crop.
  7. Test long headings, translated strings, reduced-motion preferences, and slow connections.

Capture and review a banner automatically

For visual regression checks or documentation, capture the rendered page at the viewport sizes your design supports. A browser screenshot tool can verify the desktop and mobile states, but remember that a screenshot is evidence of one state, not a substitute for keyboard and assistive-technology testing.

Or skip the browser setup

ScreenshotNeo provides a website screenshot API and MCP server. One GET request returns PNG, JPEG, WebP, or PDF. Cookie and consent banners, newsletter popups, and chat widgets are removed before capture; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers identify the page verdict and billing result. Its MCP tools let Claude, Cursor, and other MCP clients call take_screenshot, get_page_info, and capture_pdf.

See the ScreenshotNeo API documentation for all options, including full-page and element capture, device presets, custom viewports, retina scale, waits, custom CSS and JavaScript, hidden selectors, request blocking, headers, cookies, geolocation, caching, signed links, async jobs, bulk capture, and usage reporting.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://example.com \
  -o banner.webp

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://example.com"},
    timeout=90,
)
r.raise_for_status()
open("banner.webp", "wb").write(r.content)

Node.js

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://example.com'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot failed: ${res.status}`);
const buffer = Buffer.from(await res.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('banner.webp', buffer));

There are 1,000 screenshots per month free with no card. Paid plans start at $5 for 3,000 shots, and every feature is included on every plan. Create a free ScreenshotNeo account.

Performance, reliability, and cost considerations

  • Keep source images efficient. Use modern formats, responsive sizes, and a sensible compression level. Large hero files delay the first meaningful content.
  • Reserve space. Set an aspect ratio or minimum height to reduce layout shift while the image loads.
  • Prefer one stable hero. Carousels add interaction and loading work while making the primary message less predictable.
  • Capture the states you need. For screenshot automation, use a wait for a selector, a delay, or network idle when the banner depends on client-side rendering.
  • Use caching for repeated reviews. A chosen TTL can reduce duplicate captures; invalidate it when banner content changes.
  • Inspect verdict headers. With ScreenshotNeo, distinguish a clean billed capture from a bot check, blank page, timeout, failed load, or cache hit before storing it in a regression set.

Troubleshooting

Symptom Likely cause Fix
Text is unreadable over the image Insufficient contrast or a busy crop Add a solid or translucent overlay, change the focal point, or move text outside the image. Recheck in every responsive state.
The mobile banner is clipped Fixed height or desktop crop reused on a narrow viewport Let height grow with content, change the grid to one column, and use a mobile-specific image crop if needed.
Screen reader repeats or misses the banner Decorative panels were assigned role="banner", or text exists only in an image Use one site-wide header landmark, keep words in HTML, and give informative images concise alt text.
Keyboard users cannot activate the CTA A clickable div or hidden focus outline Use a real link or button, preserve logical tab order, and provide a visible :focus-visible style.
Screenshot shows a consent dialog or chat bubble The capture ran before cleanup or the tool does not remove those elements Wait for the page state, hide known selectors, or use ScreenshotNeo’s pre-capture consent and widget removal.
Screenshot is blank or times out Slow client rendering, blocked resources, authentication, or a bot check Wait for a meaningful selector, supply required headers or cookies, inspect the verdict headers, and retry only transient failures.
API response is not an image Invalid key, URL, or an HTTP error Check the status code and response headers before writing the body to a file; verify the access key and URL encoding.

FAQ

Should every page have a hero banner?

No. Use one when it clarifies the page’s main purpose. A task page may be clearer with a direct heading and form.

Is a banner the same as a header?

No. A header is site chrome or introductory content. The ARIA banner landmark specifically identifies repeating, site-wide header content; a hero is a visual or message component.

What is the best banner size?

There is no universal size. Follow your design system or platform specification, then test the crop and content at real viewport widths.

Can I place all banner copy in a background image?

Do not do that for meaningful content. Keep the words in HTML and use the image as supporting decoration or context.

How many calls to action belong in a hero?

Usually one primary action. Add a secondary link only when users genuinely need a separate path and its visual priority is clear.