Skip to content

Background image with CRA #2725

Answered by simonswiss
natsathorn asked this question in Help
Discussion options

You must be logged in to vote

Hey,

If you're trying to reference an image from your CSS in Create React App, it's going to try and reference it from the compiled CSS file.

Instead of having it in your src directory, I think you need to put that image in your public folder: https://create-react-app.dev/docs/using-the-public-folder/.

Have a try and see how you go! 🤞

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@natsathorn
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by simonswiss
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants