Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Add custom background from file with tailwind - Theo's Typesafe Cult
TTC
Theo's Typesafe Cult
•
4y ago
•
28 replies
Perchant
Add custom background from file with tailwind
I would like to add custom background to website via local file and I used this
<div class="bg-[url('/your/image.svg')]">
<!-- ... -->
</div>
<div class="bg-[url('/your/image.svg')]">
<!-- ... -->
</div>
Doesnt work
Then I tried add the image to
/src
/image or just
/src and it didnt work
visited these 2 posts and nothing worked
https://github.com/tailwindlabs/tailwindcss/discussions/3113
https://github.com/tailwindlabs/tailwindcss/discussions/8877
Any suggestions
?
GitHub
I can't set a backgorund image in tailwind.config.js because of fai...
I wrote the following file using this as the reference about customizing backgroud image
. module
.exports
=
{ purge
:
[
"
;
.
/src
/
*
/
.tsx
"
;
]
, darkMode
: false
,
/
/ or
&
#39
;media
&
#
.
.
.
GitHub
setting arbitary value for background gives module not found error ...
Please read the problem here
https://stackoverflow.com/questions/72949611/react-giving-error-on-tailwind-class-bg-url-images-bg-header-mobile-svg?noredirect=1#comment128891967_72949611
Theo's Typesafe Cult
Join
26,564
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
add tailwind
TTC
Theo's Typesafe Cult / questions
2y ago
Use background image in tailwind
TTC
Theo's Typesafe Cult / questions
3y ago
Tailwind CSS dynamically add classes
TTC
Theo's Typesafe Cult / questions
2y ago