In this post, I will present to you the Jumbotron and Jumbotron-Fluid, which are new components in Bootstrap 4. As the name suggest (jumbo+tron), the Jumbotron class can increase the size of headings and add margins for the content displayed on a landing page.
A jumbotron shows a big box that highlights some special information or content.
To get a jumbotron of full width, and without rounded corners use the .jumbotron class outside all .container classes and instead add a .container within, as shown in the following example −
Tip: Inside a jumbotron, you can put nearly any valid HTML, including other Bootstrap elements/classes.
<div> element with a class to create
.jumbotron. You have 2 types of Jumbotron in Bootstrap 4:
The code snippet:
<h1 class="display-3">Hello, world!</h1>
<p class="lead">This is a simple hero unit, a simple jumbotron-style component for
calling extra attention to featured content or information.</p>
<p>It uses utility classes for typography and
spacing to space content out within the larger container.</p>
<a class="btn btn-primary btn-lg" href="#" role="button">Some action</a>
2. Jumbotron Fluid
<div class="jumbotron jumbotron-fluid">
<h1 class="display-3">Fluid jumbotron</h1>
<p class="lead">This is a modified jumbotron that occupies
the entire horizontal space of its parent.</p>
See it in action here.
- Create a <div> that acts as a .container.
- Inside this <div> create another <div> with the class of .jumbotron.
- Next, add HTML headings to see the Jumbotron effect using the .jumbotron class.
- After we execute this HTML code, we can clearly observe that in addition to a larger <h1> heading, the font-weight has been reduced to 200px.
In this blog post, we discussed the jumbotron class feature that is available in Bootstrap 4 along with various examples which cover full simple, rounded corners and fluid aspects of Jumbotron.