Jobin Jobin - 1 year ago 138
HTML Question

How to give the background-image path in CSS?

My CSS file is in :


My image is in :


I want this image in my CSS file.

I have tried :

1) background-image: url(/images/image.png);
2) background-image: url('/images/image.png');
3) background-image: url("/images/image.png");
4) background-image: url(../images/image.png);
5) background-image: url('../images/image.png');
6) background-image: url("../images/image.png");

But. i'm not getting this image in my page.

What is the correct way to specify the path of image file in the css file ?

Answer Source

Your css is here: Project/Web/Support/Styles/file.css

1 time ../ means Project/Web/Support and 2 times ../ i.e. ../../ means Project/Web


background-image: url('../../images/image.png');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download