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

Helper ⭐️⭐️
Mar 12, 2021 11:28 PM UTC

Hi Frank - can we update the image itself with custom CSS? We changed the size of the container, but the image we uploaded is stretched to fit it. We would prefer to re-upload the image with the correct aspect ratio from our own server. Is this possible? @anthony.hopkins 

Translate
Contributor ⭐️⭐️
Mar 12, 2021 11:33 PM UTC

Is there a way to overwrite the background image within the CSS?

 

When I inspect the image I see:
<div class="brand-hero qa-brand-hero custom-hero-banner" style="background-image: url(https://downloads.zemax.com/zemax-portal/cloud.jpg)">

In the custom CSS I put:
.brand-hero .qa-brand-hero .custom-hero-banner  {
background-image: url(https://downloads.zemax.com/zemax-portal/cloud.jpg);
}  

 

But unfortunately this code didn’t overwrite the InSided background within the header.

Translate
Blastoise186
Helper ⭐️⭐️⭐️
Mar 13, 2021 12:18 AM UTC

Hiya! I can try to answer both of those.

@alexandra.culler I would recommend uploading the image again based on your preferences. However, its worth noting that CSS can't fix aspect ratio issues. 

@anthony.hopkins I'm afraid that's actually not what CSS is designed to do I'm afraid. You'll probably want to undo your changes and upload the images within Control and set them up as the hero banner. It will work out a lot better that way. 

Translate
Bug blasting absolutely everything... The Blastoise Way
Helper ⭐️⭐️
Mar 13, 2021 12:41 AM UTC

Hi @Blastoise186 - thanks! My problem is that the InSided uploader does not allow us to re-upload with a taller image, even when we give the header more vertical space. We are always limited to the same HxW which results in the image looking stretched or blurrily-expanded when we change the size of the hero banner space. I will probably end up finding a different image 🙂. 

Ps: love that signature!

Translate
Blastoise186
Helper ⭐️⭐️⭐️
Mar 13, 2021 9:34 AM UTC

No worries @alexandra.culler ! Glad it helps. It’s sometimes a bit tricky because the banner also needs to show on mobile as well. I think you can sometimes get away with minor tweaks, but if you push things too far, it goes badly wrong.

I’m only a user both here and at my home base though, so I don’t have access to Control myself. There might be some kind of secret hack for this, but it’s not something I’ve come across.

I’m glad you like my signature too! There’s actually a joke behind that. If there’s one thing I’m known for… It’s basically smashing up pretty much everything I use to pieces with all the bugs I find. :innocent:

Translate
Bug blasting absolutely everything... The Blastoise Way
nicksimard
Contributor ⭐️⭐️⭐️⭐️
May 11, 2021 4:50 PM UTC

@anthony.hopkins As with all things CSS-related, proceed with caution, but here’s what I did to get a taller image:

I set the height of .custom-hero-banner to what I wanted (I chose 600px) then I used:

 

.brand-hero {

  background-size:1250px;

  background-position:center center;

  background-image: url("direct-link-to-your-image")!important;

  padding-bottom:150px;

  padding-top:120px

}

 

You’ll want to modify the settings in there to work with your image and how you want the search bar to appear, and check to see how it all looks on mobile, but that should at least get you started :)

Translate
Come check out the Zapier Community (built with inSided) at https://community.zapier.com!
timcavey
Helper ⭐️⭐️
Jun 23, 2021 8:34 AM UTC

Hi @nicksimard @Frank et al,

 

Do we need to create CSS to have a sub header in the 'Hero Banner'? 

Translate
learning, sharing and repeat
nicksimard
Contributor ⭐️⭐️⭐️⭐️
Jun 23, 2021 4:54 PM UTC

Hey @timcavey I didn’t create it personally, but I do see that we had a subtitle added via Third-Party Scripts under the Customization menu. It’s currently hidden on our site, but it’s definitely possible to add one. 

Translate
Come check out the Zapier Community (built with inSided) at https://community.zapier.com!
timcavey
Helper ⭐️⭐️
Jun 23, 2021 5:07 PM UTC

Thanks @nicksimard yep one of our devs has assured me they can do it in 10 minutes. Let’s see, it’s being worked tomorrow :nerd:

Translate
learning, sharing and repeat
SmartlyGreg
Helper ⭐️⭐️⭐️
Dec 17, 2021 5:29 PM UTC

@timcavey I recently did this so if you haven’t done so already this is a trick to do it:

To add the HTML in the right place: (Third party script before Body close)

<!-- Insert Tagline in header -->
<script>
var theHead = document.getElementsByClassName("qa-brand-hero-title");
var newDiv = document.createElement("div");
var input = document.createTextNode("YOUR TAGLINE GOES HERE");
newDiv.appendChild(input);
theHead[0].appendChild(newDiv).setAttribute('class', 'tagLine');
</script>

To style the newly added tagline: (Custom CSS)

.tagLine {
font-size:18px;
color: red;
}

 

Translate