Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Every one,


I have one css class that is,

C#
.Image1
{
    background-image: url(~/images/error-icon.png) no-repeat;
    background-repeat: no-repeat;
    width: 15px;
    height: 15px;
}




when this css class use in user control(ascx page) image not display.
none of the browser display image.


Any solution reply me how will solve this.....
Posted
Updated 10-Jan-13 22:38pm
v2

1 solution

The reason it's not displaying is because the ~ is absolutely nothing to do with CSS. Drop that and you should pick the path up from the root of the website.
CSS
.Image1
{
    background-image: url(/images/error-icon.png) no-repeat;
    background-repeat: no-repeat;
    width: 15px;
    height: 15px;
}
 
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