Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a transparent jumbotron with Bootstrap v. 4.0.0?

Tags:

html

css

I've searched through the internet and haven't found any solution for the newest version of bootstrap.

I've thought of two things: Using opacity (didn't work since every other element from the Jumbotron inherits it), and setting a background image whose opacity I thought I could change later (which actually just faded from original to white, still not getting any transparency).

Is there a simple way to do this?

EDIT: A part of my HTML:

<div class="jumbotron">

  <h1 class="display-3 text-right">name</h1>

  <hr class="my-4 text-right">
    <p class="lead text-right">description</p>
  <p class="lead text-right">
    <a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
  </p>

</div>
like image 883
randomuser Avatar asked Mar 01 '18 04:03

randomuser


People also ask

How do I change the background of my jumbotron?

We can add a background image to the jumbotron using the CSS style sheet. Use . background-image : url("image_address") within the stylesheet. Here is an example to add a background image to the jumbotron.

How do I make the background transparent in Bootstrap?

To change that opacity, override --bs-bg-opacity via custom styles or inline styles.

Is there a jumbotron in Bootstrap 5?

In Bootstrap 5 the jumbotron component is removed in favor of utility classes like . bg-light for the background color and . p-* classes to control padding.


2 Answers

This could help

.jumbotron {
    background: rgba(204, 204, 204, 0.5);
}
like image 170
Anzil khaN Avatar answered Nov 12 '22 05:11

Anzil khaN


You could just add bg-transparent in your html

<div class="jumbotron bg-transparent">
  ... 
</div>
like image 39
laurent Avatar answered Nov 12 '22 05:11

laurent