I simply cannot make a background image appear in that top red nav bar. FOR THE LIFE of me!! What’s even more frustrating for me is that I it works fine in the browser but when I put in my shop-homepage.css file, IT DOES NOTHING! Any ideas?
You only need target one element or class in this case.
Just nav {} or .navbar {} would do it.
When you have a selector with items separated by space, each item following a space is a child of the previous.
So the selector you have is targeting an element with the class .navbar-fixed-top which is nested within an element with the class .navbar-inverse, which is inside another with the class .navbar which is nested in a nav element.
<nav>
<div class="navbar">
<div class="navbar-inverse">
<div class="navbar-fixed-top">This is what your selector targets</div>
</div>
</div>
</nav>
I don’t see the image, of course. So I borrowed one from placehold.it. Adding the following CSS causes the image to appear as a background image.
.navbar-inverse {
background-color: #82001c;
background-image: url("http://placehold.it/100x50/");
background-repeat: repeat; /* for this demo */
}
If the incorrect selector was deleted per @SamA74 and the CSS written the way @Webmachine showed, I don’t see why your image would not be visible unless something else is overriding it.
If my notes do not lead you to a solution, please show us a link to the real site and not the BootPly thing.
You were right, my URL was wrong for the image. I was referencing it from the index file instead of from the CSS file, duh!! ::Palm plant:: thanks everyone!