Meteor Template background-image

Hi, everyone, please, how can one set background image on meteor template, any suggestion is highly appreciated.

Like in every other HTML/CSS page, give the container you want an id or class and then use CSS to apply the background image.

You just need to put it in the client/ directory in your app’s root directory.

Yes, i have done that but still not working. (in the public directory)

No, it should not be in public directory. It should be in client/ in your app root. Files in public directory don’t get automatically loaded by Meteor.

Thanks bro!, but not working yet

Here’s a really quick example that will show it working; try this and compare it against your app to see where the difference lies.

  1. Create/run a test app:
meteor create background-image-test
cd background-image-test
meteor npm install
mkdir public
meteor
  1. Put a test image in ./public/images/background.jpg

  2. Update /client/main.css with:

body {
  background: url('/images/background.jpg') no-repeat;
}

Oh,Thanks bro, this works.

Yes, this works actually! thanks. Please can you help with some solution on how to slide images with carousel in my template? Thanks.