hi, i’m trying to figure out why my image doesn’t shows up. I’m doing this with React.js
<div>
<div className="home-page">
<h1>The home page</h1>
</div>
</div>
.home-page {
background-image: ('./images/spa.jpg');
background-size: cover;
height: 100vh;
}
Oh gosh. I just saw the problem when I posted here, I don’t have an ‘url’ next to ()
Dob6458
3
In HTML, he have a element to display a image, this is the <img>
.
There is the code to solve this :
<img src="image.png" alt="img_not_displayed" />
That’s for an image within the page. S/he’s setting one as background, so the CSS style is appropriate. It just happens to have an incorrect URL.
I learned HTML back in 1997 for the first time and keep forgetting that we can’t code background in HTML anymore!