Lesson 13 / Design

Crafting Captivating Hero Sections

Time
37 min
Type
Reading + Practice
Level
Intermediate

Design responsive hero sections that make a strong first impression, communicate a clear message, and guide users toward action.

Teacher Notes / In-Class Use

Demo Live

  • Model the core workflow from the lesson using a small class example.
  • Connect the example back to the first goal: Understand why above-the-fold content still matters

Try In Class

  • Build a responsive hero section with a hero image, headline, supporting text, and CTA.
  • Have students make one visible change, save, refresh, and explain what changed.

Submit Or Check

  • Ask students to show the work in the browser, not only in the editor.
  • Have students commit their progress with a clear message when the checkpoint is stable.

Watch For

  • Students copying code without checking file paths, spelling, or capitalization.
  • Visual changes that work locally but break when the project is published.

Learning Goals

  • Understand why above-the-fold content still matters
  • Identify the key elements of a compelling hero section
  • Build a responsive hero section with fluid layout and adaptable typography

Introduction

The hero section of a website is like the opening scene of a movie. It's your chance to make a powerful first impression and draw users into your narrative.

A well-designed hero section can be the key to capturing attention, communicating your message, and driving user engagement.

Like a movie that must look good on both a phone and a theater screen, your hero section needs to be responsive and visually strong on any device.

In this chapter, we explore the art of crafting captivating hero sections that grab attention and adapt seamlessly to different screens.

Above the Fold: Making a Strong First Impression

Before we dive into the specific elements of a hero section, let us talk about a crucial concept in web design: the fold.

The fold refers to the portion of a web page that is visible to users without scrolling. It is the first thing they see when they land on your site, and it plays a critical role in capturing their attention and encouraging them to explore further.

In the early days of the web, the fold was considered a rigid and limited space because screen resolutions were much smaller. With today's diverse range of devices and screen sizes, the concept of the fold has become more fluid and nuanced.

Why the Fold Still Matters

  • First Impressions: The content above the fold is the first thing users see, so it needs to make a strong and positive impression.
  • Attention Span: Users often have short attention spans, and if they don't see something engaging above the fold, they might quickly leave your site.
  • Setting Expectations: The content above the fold sets the tone and expectations for the rest of the website.

Designing for the Fold

  • Prioritize key content like headlines and CTAs.
  • Optimize layout for different devices and screen sizes.
  • Keep it clean. Don't overload this space.

The Hero's Journey: Elements of a Captivating Hero Section

A hero section is typically the first thing users see when they land on your website. It is a prime piece of digital real estate, and it needs to work hard to achieve its goals.

  • Hero Image or Video: A visually striking image or video that captures the essence of your brand or message.
  • Accessibility: Always provide appropriate alt text for hero images. For videos, consider captions or transcripts.
  • Performance: Optimize large images or videos with lazy loading, compression, and modern formats like WebP.
  • Headline: A concise and impactful headline that clearly communicates your value proposition or main purpose.
  • Supporting Text: A brief paragraph or bullet points that elaborate on your headline.
  • Call to Action: A clear and compelling action that encourages users to take the next step.

Use action-oriented CTA language like "Get Started," "Shop Now," or "Sign Up Free," and make your CTA visually prominent using color, size, contrast, and whitespace.

Responsive Design for Hero Sections

Now, let us look at how to make a hero section responsive and ensure it looks strong on any device.

Fluid Grids

This example demonstrates a basic fluid grid setup for a hero section. The hero container takes up the full width of its parent but has a maximum width to keep it from getting too wide on large screens. The content is centered and adjusts based on screen size.

<div class="hero">
  <div class="hero-content">
    <h1>Welcome to Our Website</h1>
    <p>Discover amazing things and explore our services.</p>
    <button>Learn More</button>
  </div>
</div>

Fluid Grid CSS

.hero {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.hero-content {
  width: 90%;
  margin: 0 auto;
  text-align: center;
}

@media (max-width: 768px) {
  .hero-content {
    width: 100%;
  }
}

Responsive Typography

This example shows how to scale font size for headings in the hero section, ensuring readability on all screen sizes.

.hero h1 {
  font-size: 2.5rem;
  line-height: 1.2;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }
}

Real-World Examples: Hero Sections that Shine

Studying well-executed examples can inspire your own designs. These sites showcase engaging, responsive hero sections with compelling visuals and CTAs.

  • Stripe
  • Samsung
  • Apple
  • Nike
  • Nickelodeon
  • Tekken 8

Code Challenge: Build Your Own Responsive Hero Section

Create a hero section for a fictional website or a website of your choice. Include a hero image, headline, supporting text, and a call to action.

Use the principles and code examples we've discussed to ensure your hero section is visually appealing, informative, and adapts seamlessly to different screen sizes.

  • Use a fluid grid to structure the layout.
  • Make sure the hero image is flexible and scales properly.
  • Adjust typography for different screen sizes.
  • Prioritize content and hide less important elements on smaller screens.
  • Use a mobile-first navigation pattern if needed.

Checkpoint

Before moving on, make sure these feel true.

  • I can explain the main concept in my own words.
  • I can apply this lesson to my current project.
  • I can verify the result in the browser.
  • I can commit the change with a clear message.

Practice

  • Build a responsive hero section with a hero image, headline, supporting text, and CTA.
  • Use a fluid layout with a max-width.
  • Adjust typography for smaller screens.
  • Test the hero on mobile and desktop widths.