Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Tailwindcss background image not showing on deploy

Both the background image and navbar background don’t render. I’m using Vercel and Netlify to deploy and have used the build command as well as the publish directory setup on both sites. Tried checking my code since I’m using Tailwind for the first time, but I still can’t figure out what went wrong?

The repo: https://github.com/d4nky/Tailwindcss-Portfolio
The site: https://inspiring-carson-2c8f1d.netlify.app

Any piece of information would be appreciated 🙂

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You have to put img directory in your dist too, because for now, you are using path /img/background.jpg which refers to repo /dist/img/background.jpg file, that doesn’t exist.

You can check that in the console, which says:

GET https://inspiring-carson-2c8f1d.netlify.app/img/background.jpg [HTTP/1.1 404 Not Found]

And the same for logo_size.jpg.

You could put those directories directly to dist directory by hand, or use some bundling tool like webpack to automate things.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading