Skip to main content
Frank
Product Guru
Oct 29, 2019 11:56 AM UTC

Custom CSS: Hero banner

The hero banner consist of a nice visual, your community headline and the search bar. It is the very first thing your users will notice when they land on your community homepage. In this post you will learn home to change the look and feel of the hero banner by customizing its CSS.

Learn how to add Custom CSS in this article: How To Add Custom CSS

Test first: Consider using your staging environment first to test and try your changes before applying them to your production community

 

Change the height of the Hero banner image

You can change the height of the hero banner image by applying the following Custom CSS

/* hero banner change height */
.custom-hero-banner {
height: 360px; /* default: 240px */
}

 In this example we applied a height of 360px, the default height of the hero banner is 240px

 

Align headline and search on the left

You can move the community tagline and search bar to the left side by applying the following Custom CSS

/* hero banner left aligned */
.custom-hero-banner {
padding-bottom: 40px;
}
.custom-hero-banner .brand-hero-title {
text-align: left;
}
.custom-hero-banner .hero-search {
margin: 0;
}

In this example, we moved the items to the left side, by default the tagline and search are positioned in the center

 

Remove timestamp from featured banners

You can remove the timestamp in the ‘featured_banner’ topic by applying the following Custom CSS (see request)

.featuredBanner .thread-meta-item__date {display:none;}

 

Change Background Image Via CSS

You can change the background image via the CSS by adding the !important tag at the end.

/* Hero Banner Custom Background */
.custom-hero-banner{
background-image: url(image url here)!important;
}

For some extra helpful tips regarding styling background images in CSS you can view this Documentation from W3 School

12 replies

Contributor ⭐️
Oct 20, 2022 9:15 PM UTC

CSS newb here (do they still call people newbs?). We want to change the height of our banner, but when I’m playing with this on staging, nothing is changing. Is there a specific spot to place this code?: 

 

/* hero banner change height */ .custom-hero-banner { height: 360px; /* default: 240px */ } 

 

 

Translate
timcavey
Helper ⭐️⭐️
Oct 24, 2022 1:36 PM UTC

@Julesssss my understanding of this third-party scripts section is that it loads last. So any default banner styling should get overridden by your custom CSS. 

 

Are you sure the selector  .custom-hero-banner is specific enough? 

 

Out of interest would you want the same height and width dimensions for all screen sizes? 

Translate
learning, sharing and repeat