Click here to Skip to main content
15,909,530 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i wrote the following code in css file:
C#
body
{
    padding:0;
    margin:0;
     background:url(C:\USER\index.jpg);

    font:14px/20px Arial, Helvetica, sans-serif; color:#3D3C2C; font-weight:normal;
}



also link the css file from contact.aspx, and keep this image on the link properly.

But it doesn't show anything when web page is loaded.

please put your ans in details

Thanks in advance...
Posted

1.Create a folder in your project.
Add->New Folder, Name it as "Images".
2.Copy your background image and paste it inside the folder "Images"
3.In CSS, Add
background:url(~/Images/index.jpg);
 
Share this answer
 
v2
Comments
nest101234 7-Apr-14 5:01am    
but there is no option named folder for adding. I went through PROJECT>ADD NEW ITEM>.... and there is no folder option
jacobjohn196 7-Apr-14 5:15am    
Add->New Folder
nest101234 7-Apr-14 5:21am    
sorry!!! I use version VS2012 , here is a option like >FILE>ADD>.... but there is no folder option. thanks again...@jacobjohn196
nest101234 8-Apr-14 1:09am    
Thanks for being patients...................@jacob
C#
body
{
    padding:0;
    margin:0;
     background:url(C:\\USER\\index.jpg);           //use '\\', then it will work

    font:14px/20px Arial, Helvetica, sans-serif; color:#3D3C2C; font-weight:normal;
}
 
Share this answer
 
Comments
nest101234 7-Apr-14 3:36am    
no , it doesn't work...........:-(
Member 10641779 7-Apr-14 3:41am    
I tried in my system it is working. check for image path is correct or not?
nest101234 7-Apr-14 3:51am    
logically it is true that it should work. but why not??? path is correct

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