I’ve written a code in React JS and used tailwind CSS to insert a background image in my code but the image is not fitting up to the whole screen. The image is rather giving a margin from all the directions equally and I don’t know how to fix it.screenshot of how the background-image looks like
Further here is the code where i have inserted the image:
<div className="w-full h-screen flex flex-wrap justify-center items-center bg-cover object-fill bg-no-repeat"
style={{
backgroundImage: `url('bg-image.png')`,
}}
> </div>
I want the image to fit completely to the screen and not leave out the white margin. Maybe the answer is really simple but I just can’t figure out what am i doing wrong.
Apoorva Walia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.