Jump to content

Path To Find Img


jnf555

Recommended Posts

A forwardslash '/' looks in the root of your web site. Then you just type the path to the folder. For example:body {background-image:url('/folder1/folder2/bgdesert.jpg');}Of course there are other ways depending on the images relative location to the CSS file.

Link to comment
Share on other sites

The "other ways" are "./" to refer to the current directory and "../" to refer to the parent.

Link to comment
Share on other sites

Hi There, I'm having the same problem. i.e.body{ background-image:url('/images/zz-bg-21.gif');}doesn't work. The image is in my images folder, which is in the same folder as the html file.Regards, Stewart
try thisbackground-image: url('images/zz-bg-21.gif');and/or check your spelling.edit: where is the image in relation to your CSS file?
Link to comment
Share on other sites

try thisbackground-image: url('images/zz-bg-21.gif');and/or check your spelling.edit: where is the image in relation to your CSS file?
That did the trick; missing a space before the url. I was tearing my hair out over this.Cheers, Stewart
Link to comment
Share on other sites

That did the trick; missing a space before the url. I was tearing my hair out over this.Cheers, Stewart
Actually it wasn't the space that was throwing it off. It was the '/' in front of images. The forward slash refers to the root of your website. If your HTML file and the images folder are in a subdirectory of your website then you also need to include that in the path.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...