Link to home
Start Free TrialLog in
Avatar of RichardKline
RichardKline

asked on

How do you specifiy the subfolder "background-image: url(" path if the CSS, HTML and images are in different folders?

Seems lke a doofus question but...
Assuming the folder structure:
HtmlRoot = HTML file location
HtmlRoot/Images = Image location
HtmlRoot/Styles = CSS file location

The HTML file finds and loads the CSS using the syntax:  link href="Styles/t1Body.css"
The HTML finds and loads images using the syntax src="images/SMLLOGO.jpg"

But I can not find the proper CSS syntax which instructs the HTML to look in the Images folder for a background image  -- UNLESS both CSS and image file are in HtmlRoot.
I've tried: background-image: url("/Images/back.gif")
background-image: url("~/Images/back.gif")
and I'm not sure what else.

Any thoughts?
Thank you.

ASKER CERTIFIED SOLUTION
Avatar of VirusMinus
VirusMinus
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RichardKline
RichardKline

ASKER

Both work when launching IE from inside the VS2008 IDE....  Only the ../images/back.gif works when FireFox/IE are independently launched.  

I would've throught  that /images/back.gif would've worked but...

Thanks!
Try giving full URL of the image file, like.....
background-image: url(http://www.domainname.com/Images/back.gif)

Good Luck
Ravi