Why wont the background image be displayed?

Why wont the background image be displayed?

replit link

Code

<!--HTML-->
  <div class="projecthero">
    <h2 class="h2bold mrgn">Projects</h2>
  </div>
/*STYLE*/
.projecthero {
  margin-left: 0px;
  margin-right: 0px;
  max-width: 100%;
  padding: 0px;
  background-image: url('projecthero.png');
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
}

Hi @AleksisLeinats1! I see you’ve commented out the CSS styling. You might want to get rid of that first. Don’t forget: it’s best to put all <style> tags in the head or at the top of the <body> section.

If that doesn’t work, is this HTML file saved in EXACTLY the same folder as the image you’re trying to access?

Let me know if that helps! :slight_smile:

No they haven’t? What do you mean?

4 Likes

@Firepup650 Wait, no, I must’ve misread the code. The word “STYLE” was the comment. I apologize for the mistake. Thanks for pointing that out! :smile:

3 Likes

You’re good, I just tweaked formatting to make it more clear that they’re seperate.

3 Likes

Alright :)‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎‎