Why wont the background image be displayed?

Why wont the background image be displayed?

replit link


  <div class="projecthero">
    <h2 class="h2bold mrgn">Projects</h2>
.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?


@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:


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


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