Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 670
  • Last Modified:

2.0 Themes - .css file sets image location outside of theme folder

I have a theme that uses a stylesheet.  All the images are uniform across themes so I want to have the images outside the theme folder.  How do i do this?

If its a resource i can go:

background-image:url(~/images/grad01.jpg);

or if its inside the theme I can set it like:

background-image:url(images/grad01.jpg);


this:   background-image:url(./images/grad01.jpg);   doesn't seem to work if the image folder is in the root of the web app.  How can I do this?

0
bswiftly
Asked:
bswiftly
  • 2
1 Solution
 
ethothsCommented:
Whats wrong with...

background-image:url(~/images/grad01.jpg); ???
0
 
bswiftlyAuthor Commented:
well, it doesn't work!

thats whats wrong. haha.

the ~ seems to be for files that are put in as a "resource".
0
 
ethothsCommented:
The "~/" only works for server controls. If you put the images folder in the root of your web then "/" should work. If not then you have to reference from the root "/MyWebRoot/".

If your website's address is http://localhost/MyWeb/ then you will have to include the "/MyWeb/" in your path. That or make all your images server controls.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now