Reputation: 4387
I want to add a background image to my meteor webapp:
background: url('../public/img/car.jpg') no-repeat center center fixed;
But then I get the following error message:
jquery.js?hash=c334cf5…:3662 Not allowed to load local resource: file:///D:/project/app/public/car.jpg
What am I missing?
Upvotes: 0
Views: 435
Reputation: 4387
I finally found the answer here: meteor app: images not loading
Files in /public are served to the client as-is
So I had to exclude the file path and just type /car.png
Upvotes: 0
Reputation: 21374
I think you might be misunderstanding the use of the public
folder (see the doc on directory structure). Anything in that folder will be served statically on the /
URL. So I think all you need to change is this:
background: url('/img/car.jpg') no-repeat center center fixed;
Upvotes: 1