0

I've a web site on www.open-guide.com and I'm trying to put a background-image for each list item of my General Information form (Why choose us?), however I can't seem to find the right path (either relative or absolute) for the images, which I've in a folder (tour_icons) in my desktop.

I tried:

li { 
    background-image: url(../tour_icons/imagename.jpg);
}

But it is not finding it. What am I doing wrong?

dertkw
  • 7,798
  • 5
  • 37
  • 45
  • I'm not sure of the details of your problem, it would really help if you could clarify what you're doing more. From what I'm reading, I think you're trying to use images from your computer on your website. That isn't what you want to do. No one but you will be able to see those images. Please clarify more. – Avery Jun 29 '14 at 17:59

2 Answers2

1

You need to copy "tour_icons" folder into the hosted application path root, otherwise it wont find the correct file path. use / only as a prefix to start the path it will consider the root of application and define path asa string format.

background-image: url('/tour_icons/imagename.jpg');
Rashmin Javiya
  • 5,173
  • 3
  • 27
  • 49
-1

It should be:

background-image: url("../tour_icons/imagename.jpg");

You should enclose the path in quotes " or '.

Also ../ Means parent directory of current css file. if you want to access child directory use : / instead of ../.

Vedant Terkar
  • 4,553
  • 8
  • 36
  • 62