Setting a background image of the container

I want to set background image for the container how can i set in web. I am using like below .bgMain{     overflow: hidden;     background-image: url("background.png");     height: 1080px; } This image is placed in Images folder in the module. I think path is not proper please guide    
2 answers

You will probably have to put the image in the theme folder. Then reference to it there.

It always helped me to run the project, and then try and figure out the right path using the inspector ;-) And yes, it is a hassle.

Another tip: try and inspect some of the core styling to see if there are references to other files in the theme folder. If so, (e.g. f=glyphicon), then you can work from that url.


Hope this helps.


To use the image themesource/{module}/public/images/login-background.jpg from themesource/{module}/web/main.scss, you can simply use url("./images/login-background.jpg).