Meteor Template background-image


#1

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


#2

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.


#4

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


#5

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


#6

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.


#7

Thanks bro!, but not working yet


#8

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;
}

#9

Oh,Thanks bro, this works.


#10

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