Bootstrap static header

Published: 22.10.2019 | Last update: 23.6.2022

In this short snippet tutorial, I will show you how to create a Bootstrap header with the background image.

This snippet is for beginners. A short piece of code will help you to quickly get your header with the background image in place.

We will be using a simple jumbotron-style component, to create a nice Bootstrap 4 header with a background image.

Alright, let's do it.

When to use background images in headers in web design?

If you want your website design to stand out, then the header is the most important element of your website.

While you can use background images in your header, there are certain situations when it's best to use the standard header backgrounds, and others when sticking with a solid color might be the best option.

When to use header with an image

If you want to add some visual interest to your header but don't want to get too complicated, then an image might be ideal for you. Images draw attention to themselves and can help grab users' attention if done correctly — although this isn't always true!

Be sure not to overuse images; otherwise, they'll start looking like wallpaper instead of an actual design element. One way around this problem is by using subtle textures or patterns instead of photos or illustrations; these elements can still draw attention without stealing all the focus from your content area!

When to use a solid color

A solid color is always a good option if you want to keep things simple. A solid hue works well in any kind of design because it provides a clean, consistent look that will tie together the rest of your website.

If you're using photography or other images as part of your header design, make sure they coordinate with each other and with the rest of your site so that everything ties together seamlessly.

If you liked this snippet, you might also enjoy exploring Bootstrap Cards or Bootstrap profile page .

Please note that the interactive editor on this page should be viewed on your laptop or desktop for the best results.

See my free Bootstrap themes Edit this snippet

How to use the snippet

There are two ways to use the snippet:

  • a] Copy it into your project. This means:
    1. Copy content of the HTML, CSS, JavaScript tabs into your project
    2. Make sure that you have jQuery 3 and Bootstrap 4's CSS and JS included in your project too.
    3. That should be it, and you should be good to go.
  • b] Use the "Edit in JSFiddle" link in the top right and play with it in the JSFiddle. After adjusting what you need, you can use the same steps as in a] to develop it locally.
Share on Facebook Share on Twitter Share on LinkedIn