Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a image in my project folder then Admin folder then images folder

how can i call it in css
CSS
background-image:url(./admin/images/yello.jpg);

can anyone correct me
Posted
Updated 30-Dec-11 23:15pm
v2
Comments
Suraj S Koneri 31-Dec-11 7:15am    
not solution but some suggestion use <pre lang="c#">background-image: url('~/admin/images/yello.jpg');</pre>

Use,

background-image: url('../admin/images/yello.jpg');
 
Share this answer
 
Comments
codegeekalpha 31-Dec-11 6:24am    
its not working
What means "does not work"? Please specify more precisely.

You may try the following:

  1. make sure that with each trial that you don't load the page from cache (this kind of problem drove me crazy in the past)
  2. leave away the ./ or ../, simply use the relative path (e.g. admin/images/yello.jpg)
  3. try to load the jpeg file by entering the path in your browser (if this fails, fix the path and use it in your CSS)
  4. if the above all fails: give more detail so that we can give more prcise advise ;-)


Cheers

Andi
 
Share this answer
 
Use this
C#
background-image:url('~/admin/images/yello.jpg');
 
Share this answer
 
Try
background-image: url("/admin/images/yello.jpg")

Reference LInk :- CSS Background[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900