Alter the background of only one jumbotron

I have a situation where I need to customize the color of one of the two jumbotrons on my page. Here is the HTML for the jumbotrons:

<div class="jumbotron jumbotron-fluid">
  <div class="container">
    <h3 class="display-5">TEST</h3>

After trying to change the background color of just one of the jumbotrons in CSS, I realized that both jumbotrons were affected by the changes.

.jumbotron-fluid{
    background-color: red!important;
}

I attempted to use an ID to target and modify the background color of one specific jumbotron, but unfortunately, it did not work as intended.

Answer №1

Try adding an ID to the jumbotron - there is no reason it shouldn't work

  #id {
      background-color: red!important;
   }

Alternatively, you can add another class to it

  <div class="jumbotron red"></div>

CSS

  .red {
      background-color: red!important;
   }

Or you can use inline styles

     <div class="jumbotron" style="background-color: red"></div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Adding a border around the `<tr>` elements in a table

How can I add a border to the <tr> element (t_border), without the inner table inheriting the style from the outer one? <table> <tr> <td>A</td> </tr> <tr> <td> <ta ...

Extracting the inner content in the absence of an HTML element, only plain text

My website's platform has some unusual HTML that I need to work with. There is a section of code that looks like this: <div class="report-description-text"> <h5>Description</h5> Welcome to Ushahidi. Please replace this report with a ...

When I trigger a function by clicking, I also set a timeout of 1 second. Is it possible to deactivate this timeout from within the function itself?

One button triggers a function with a timeout that repeats itself upon clicking. Here's the code snippet: function chooseNum() { let timeout = setTimeout(chooseNum, 1000); } To disable this repeating function, I attempted another function like so ...

Using AngularJS to handle error validation for dropdowns and select elements that will redirect using the ng

Currently, I am utilizing angularjs's ng-href along with a select HTML element containing ng-model. The ng-href is being used to link to the "selectedItem" from ng-model. However, I have encountered difficulty in validating or displaying an error mess ...

When the cursor hovers over an item, I would like to enlarge its width while simultaneously shrinking the width of two additional items

Here is a section that I have created, you can view the mockup here. The section is divided into 3 parts, each taking up around 33.3% of the width and floated. My goal is to make it so that when a specific element, like .col-one in my example, is hovered ...

HTML Error: The result is unspecified

I have written a function that is supposed to return 105; 6.5 and 110; 4.5, but instead it returns undefined: undefinedundefined: undefined. Can someone please advise me on what changes I need to make to get the correct results? I have heard about asynchro ...

Determine if a link can be activated or disabled

Controlling the clickability of a link and displaying an error based on the result of an ajax call is my current objective. <a class="lnkCustomer" href="http://localhost/viewcustomer" target="_blank" data-customerno="2 ...

Conceal the bottom HTML/widget and eliminate the Drag & Drop functionality from the Streamlit file_uploader() feature

I have developed an application using Streamlit that requires the ability to read multiple files simultaneously. To achieve this, I am utilizing the file_uploader() component with the parameter accept_multiple_files=True. I have two queries: Firstly, is ...

Using CSS grid for optimal responsive design

Today I delved into the world of CSS grid and instantly saw its potential in creating stunning layouts. However, one aspect that has me perplexed is how to adapt the grid for mobile devices. Below is an example that functions perfectly on a desktop screen ...

accommodating multiple background images in CSS

I am currently working on a WordPress website using the Twenty Twelve theme. On one of the pages, I am trying to incorporate three background images - one at the top, the next one right below the top image, and the third one at the very bottom... Is there ...

Base64 image failing to display in Internet Explorer

Is there a way to efficiently handle the base 64 form of an image in different browsers? The code I have achieves this as shown below: import base64 import requests img=requests.get('https://example.com/hello.jpg') base=base64.b64encode(img.cont ...

Master the Art of Creating Responsive Table Rows

Can someone please help me with making my table of rows and columns mobile responsive? I have inserted data from the database, but it doesn't adapt well for mobile devices. I have used element1 and content1 id for the background of the elements, but h ...

Troublesome button appearance

I set up two sections to gather user information using buttons. My goal is for the button styles to change when clicked, making it clear to users which option they have selected, even if they switch between sections. However, I encountered an issue where ...

Bootstrap 5 - Create a full-screen modal perfectly aligned with its parent element

BootStrap 5 Incorporating the following layout: <div class="row flex-nowrap"> <div class="left"> <!-- leftbar --> </div> <div class="main overflow-auto position-relative"> <!-- ...

Steps to center the search form in the navbar and make it expand in Bootstrap 5

I'm utilizing Bootstrap v5.1.3 and have included a navbar as shown below: navbar Here is the code for that implementation: <div class="container"> <nav class="navbar navbar-expand-lg navbar-light bg-light& ...

Employ a distinct styling approach for Chrome and Mozilla with only utilizing a single style

This is the CSS style defined in a PHP file for an Element line-height: 120px; display: list-item; display: -moz-inline; list-style: none; If the browser is Chrome, I want it to show display: list-item, and if it's Mozilla, then display: inline. Th ...

Animate the opening and closing of a div element

A form is set up for editing. Within this form, there are 2 separate divs. The first div is labeled editForm, which displays the form for editing, and the second div is labeled infos, which shows the details of this form. My goal is to have the infos se ...

Looking to personalize the appearance of an iframe using CSS styling?

I am working with an iframe that generates a form, and I would like to customize the CSS of this form. How can I go about editing the CSS? <div class="quiz-container" style="text-align: center;" data-quiz="#######" data-pr ...

moving a simulated element to a new location

Looking for some help with my html/CSS code that creates a unique element at the bottom of a div with an image background. The shape I've created is positioned at the bottom of the div... Below is the HTML: <div style="background-image:url(&apos ...

Ways to initiate animation using CSS when the page loads

Is there a way to initialize the counter on page load? Even though I was successful in making it start on hover, I couldn't figure out how to make it work when the page loads. Here is the JavaScript code: var root = document.querySelector(':root ...