Skip to main content
Inspiring
October 4, 2024
Answered

Making a grid transparent

  • October 4, 2024
  • 1 reply
  • 652 views

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
This topic has been closed for replies.
Correct answer Ben M

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;"> 

1 reply

Nancy OShea
Community Expert
Community Expert
October 4, 2024

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:

 

 

Nancy O'Shea— Product User & Community Expert
Ben MCommunity ExpertCorrect answer
Community Expert
October 4, 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;"> 

gunzelguyAuthor
Inspiring
October 5, 2024

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