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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Try giving full URL of the image file, like.....
background-image: url(http://www.domainname.com/Images/back.gif)
Good Luck
Ravi
background-image: url(http://www.domainname.com/Images/back.gif)
Good Luck
Ravi
ASKER
I would've throught that /images/back.gif would've worked but...
Thanks!