Home > Software engineering >  React.js - problem of not appearing Background
React.js - problem of not appearing Background

Time:11-26

My background image is not appearing on the output. It only doesn't work on the Contact Us page, while on other pages it's working. The div is showing the correct style in the console.

<div style={{backgroundImage: "url(images/iletisim.jpeg)"}}>

Here is a screenshot of the application

CodePudding user response:

Check the image is your right directory.

import image from "../../images/iletisim.jpeg";
.
.
.

<div style={{backgroundImage: `url(${image})`}}>
.
.
.

</div>

  • Related