Set an image saved locally as background with Tailwind in a NextJS project
Hey Dumbfuck, this is how you set an image saved localy as background with Tailwind in a NextJS project

Search for a command to run...
Hey Dumbfuck, this is how you set an image saved localy as background with Tailwind in a NextJS project

No comments yet. Be the first to comment.
That time I reverse engineered an AI startup to prove a point.

Tired of seeing ../../../components/Button in your React imports? Absolute imports are your solution for cleaner, more maintainable code. Here's how t

When all your colleagues are remote, how to communicate effectively to avoid conflicts and confusions.

In this blog, I am keeping a draft example of the modern tsconfig file that works for me in the projects that I am making. { "compilerOptions": { "target": "ESNext", "experimentalDecorators": false, "module": "commonjs", "rootDir": ...
Dear Diary,
Today, I acted like a total dumbfuck!
I just struggled 10 minutes to setup a locally saved image as a background in a NextJS component using tailwind.
I am writing this so that if you're in the same position, you don't get frustrated as I did.
#Component where you want to add the image
#Save the image in the nextjs public folder.
<div
className={`h-screen bg-no-repeat bg-cover`}
style={{ backgroundImage: `url('/awesome-bg.png')` }}
>
Text inside the component
</div>
Remember to refer back to this if you forget again, you dumbfuck!