When I put background-image: url() in to .css , browser doesnt put that image in that postition, but when i write that command in .aspx i get the image. Why it cant to call image from .css , i am making few themes so i have in every theme one .css and in each i want to have other header pict for example.
Asked
Active
Viewed 652 times
0
-
Is the image from the css not being found? Or just being positioned incorrectly? Can you include some of your css/markup? – ataddeini Apr 25 '11 at 13:33
-
not found #header { background-image:url(pict/logo.jpg); background-repeat:no-repeat; } – mikrimouse Apr 25 '11 at 13:34
1 Answers
2
When you use pict/logo.jpg
in your .css file, this is relative to the location of the .css file, not the file it's included in. If you put it in your .aspx, it's relative to the .aspx. You probably just need /pict/logo.jpg
See this previous question:
Using relative URL in CSS file, what location is it relative to?

Community
- 1
- 1

Lou Franco
- 87,846
- 14
- 132
- 192