# Hero sections

> A hero section is a lightweight container for showcasing content. They are commonly used on the Home page, but can be used in any page template.

Source: https://www.zenplates.co/documentation/elements/hero-sections (Elements › Layout)

## Usage

Use `.hero` to create a flexible hero section.

Although hero section elements are simple and can be used in a variety of contexts, those used on the Home page of our themes typically contain configurable background images, colors and headings. Shape dividers and popular search terms can also be added using theme settings.

**Example: Hero section with background**

```html
<div class="hero bg-cover bg-center bg-home py-9">
  <div class="container relative z-20">
    <h1 class="text-center font-size-4xl">
      How can we help?
    </h1>
    <SearchBox className="search-lg max-w-md my-5 mx-auto" />
  </div>
  <div class="absolute top-0 left-0 h-full w-full bg-hero"></div>
</div>
```

### Background settings

| Name                         | Description                                                              |
| ---------------------------- | ------------------------------------------------------------------------ |
| **Home hero image**          | The background image to use for the hero section on the Home page.       |
| **Hero background color 1**  | The primary hero background color.                                       |
| **Hero background color 2**  | The secondary hero background color.                                     |
| **Hero background gradient** | Determines how the two colors above are used.                            |
| **Hero image style**         | Determines how the underlying hero background image should be displayed. |

The background image will be visible if one or more of the background colors are semi-transparent or the **Hero image style** setting is set to "Overlay".

### Layout settings

| Name                   | Description                                                          |
| ---------------------- | -------------------------------------------------------------------- |
| **Hero shape divider** | The shape divider, if any, to use at the bottom of the hero element. |

To add or restyle hero sections without code, use the [visual builder](https://www.zenplates.co/documentation/visual-builder/adding-elements).
