I am working with Reactjs (Nextjs), i put my images folder in "public" folder and in "style.css" file i changed path but image is not showing,Where i am wrong ? Here is my current code
background-image: url('/hero.jpg');
I am working with Reactjs (Nextjs), i put my images folder in "public" folder and in "style.css" file i changed path but image is not showing,Where i am wrong ? Here is my current code
background-image: url('/hero.jpg');
When you create a Nextjs app, your styles are in a styles folder so your path should be
background-image: url('../public/{...maybe some folders in between}/hero.jpg');
first, import your local image into the expected file.
import bg from [your path] '../../images/bg.png';
<div style={{background: `url(${bg})`}}>
... ... ...
</div>