you have to create all of the subfolder from within the program. do not create new folders using windows explorer. create a folder named i.e. "Images" by right clicking on your site and then New Folder. then drag and drop any images you want to use into
that folder! then use the images you would usually do in the CSS file!
sheen_buhay
Member
711 Points
539 Posts
background-image not displaying properly
Dec 05, 2011 10:38 AM|LINK
Hi,
I am unable to display my CSS background-image in my web form with several attempts failed.
I've tried these several attempts such as:
background-image: url("~/imgmenu/menu_level1_item.png");
background-image: url('~/imgmenu/menu_level1_item.png');
background-image: url(~/imgmenu/menu_level1_item.png);
background-image: url(/imgmenu/menu_level1_item.png);
background-image: url(imgmenu/menu_level1_item.png);
I place my images on my /imgmenu folder on the application root under /WebApplication1 folder, my css file is declared properly.
I could not figure it out on what went wrong.
Please help. Thanks.
SheenBuhay
Chetan Chopa...
Participant
1980 Points
347 Posts
Re: background-image not displaying properly
Dec 05, 2011 10:47 AM|LINK
Try
background-image: url(../WebApplication/imgmenu/menu_level1_item.png);
where is ur css file is stored.?
gaikwad_anil...
Contributor
2805 Points
534 Posts
Re: background-image not displaying properly
Dec 05, 2011 10:47 AM|LINK
use like this
background-image: url('imgmenu/menu_level1_item.png');
www.thecodekey.com
Please mark as answer if useful
kedarrkulkar...
All-Star
34411 Points
5534 Posts
Re: background-image not displaying properly
Dec 05, 2011 10:49 AM|LINK
the image folder path should be relative to css file... so this might work considering there are two separate folders one for css and other for image
background-image: url(../imgmenu/menu_level1_item.png);
also, make sure the folder name is imagmenu and not imagemenu... (is e missing in foldername? a thought)
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
Swathi Nagar...
Member
254 Points
52 Posts
Re: background-image not displaying properly
Dec 05, 2011 10:50 AM|LINK
http://www.tizag.com/cssT/background.php
Format-
<div class="example_code notranslate">body{
background-image:url('gradient2.png');
}</div>
sheen_buhay
Member
711 Points
539 Posts
Re: background-image not displaying properly
Dec 06, 2011 02:00 AM|LINK
@chetan,
kindly refer to this 3 links:
http://imageshack.us/photo/my-images/256/cssfolder.jpg/
http://imageshack.us/photo/my-images/191/csscode.jpg/
http://imageshack.us/photo/my-images/267/imagefolderlocation.jpg/
Thanks.
SheenBuhay
kedarrkulkar...
All-Star
34411 Points
5534 Posts
Re: background-image not displaying properly
Dec 06, 2011 05:45 AM|LINK
did u try this
background-image: url(../imgmenu/menu_level1_item.png);
this should work
hope this helps...
KK
Please mark as Answer if post helps in resolving your issue
My Site
sheen_buhay
Member
711 Points
539 Posts
Re: background-image not displaying properly
Dec 06, 2011 07:56 AM|LINK
@kedarrkulkarni,
I've tried your suggestion however it's still not working.
SheenBuhay
MichaelZanne...
Member
2 Points
2 Posts
Re: background-image not displaying properly
Jan 04, 2012 10:10 AM|LINK
you have to create all of the subfolder from within the program. do not create new folders using windows explorer. create a folder named i.e. "Images" by right clicking on your site and then New Folder. then drag and drop any images you want to use into that folder! then use the images you would usually do in the CSS file!
sanjananb
Member
2 Points
2 Posts
Re: background-image not displaying properly
Jun 17, 2012 05:51 AM|LINK
There should be a problem in your image folder