I have been trying for the last 3 days to get background-image to work in css. I was able to get it to work in the past but I am not sure what is wrong now. At this point I copied a hero image example off of W3C and that didn't work either. I am trying to use background-image to add a header to my page. I do like the hero image idea so I'd like to stick with it.
The first set of code that I used was:
header { background-image: url("banner.jpg"); }
<header>
<h1>Donald Goines</h1>
</header>
This rendered nothing as far as the picture goes. Donald Goines came up though. I also tried ../images/banner.jpg in the url because I realized that I did place this image in a folder within the original folder. I validated what I had and it came back with no errors.
<body>
<div class="hero-image">
<div class="hero-text">
<h1>Donald Goines</h1>
<p>Author</p>
</div>
</div>
</body>
.hero-image {
background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("../images/banner.jpg");
height: 50%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
}