I am facing an issue with displaying a background image in my project.
The image is stored in the public folder and named bg.png
.
In the index.js
file located in the pages folder, I have attempted to set this image as a background but it seems to not be working.
Following the official documentation of Tailwind CSS, I have successfully installed the framework.
Despite trying the following code snippet, the image does not display:
import BG from "../public/bg.png";
return (
<div
className="bg-scroll"
style={{
backgroundImage: `url(${BG})`,
height: "972px",
}}
>
</div>
)
I am unsure why the image is not showing up on my page.