• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Making a grid transparent

Explorer ,
Oct 04, 2024 Oct 04, 2024

Copy link to clipboard

Copied

I have a page with a background image. When I put a grid onto the page I can't make it transparent so that you can see the background image.

 

.grid-container {
  display: grid;
  grid-template-columns: auto auto auto;
  
  padding: 5px;
}
.grid-item {
 
  padding: 20px;
  font-size: 15px;
  text-align: left;
 
If I delete the navbar CSS the grid gets a black background
  .navbar {
      margin-bottom: 0;
      border-radius: 0;
 background: #F0F3F4;
    }
 
Here is the page, still under construction
TOPICS
Bootstrap , Code

Views

244

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 04, 2024 Oct 04, 2024

Your navbar has both a navbar and navbar-inverse class. If you remove the color from "navbar" you end up with the inverse background which is #222 which is nearly black (#000). If you want a transparent effect remove the navbar-inverse class and just add an inline style so this doesn't impact all navbars like:

 

<nav class="navbar" style="background:transparent;"> 

Votes

Translate

Translate
Community Expert ,
Oct 04, 2024 Oct 04, 2024

Copy link to clipboard

Copied

Bootstrap's "navbar-inverse" has a light gray background by default.  Is that what you're struggling with?  I don't see any black containers.

https://www.w3schools.com/bootstrap/bootstrap_ver.asp

 

See screenshot:

image.png

 

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2024 Oct 04, 2024

Copy link to clipboard

Copied

Your navbar has both a navbar and navbar-inverse class. If you remove the color from "navbar" you end up with the inverse background which is #222 which is nearly black (#000). If you want a transparent effect remove the navbar-inverse class and just add an inline style so this doesn't impact all navbars like:

 

<nav class="navbar" style="background:transparent;"> 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 05, 2024 Oct 05, 2024

Copy link to clipboard

Copied

Thank you so much Ben, your solution achieved exactly what I wanted.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 05, 2024 Oct 05, 2024

Copy link to clipboard

Copied

LATEST

Bootstrap navbar classes & color schemes.

https://getbootstrap.com/docs/4.3/components/navbar/

 

image.png

 

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines