BelowZero Posted March 13, 2012 Share Posted March 13, 2012 I'm trying to apply a background image to a nested <div>. The result is as expected in IE9, but nothing is rendered in Safari 5.1.2 or Firefox 3.6.27. Haven't tried it in any other browser. The html is just this. I want to place a background image in "layer2" : <div id="layer1"> <div id="layer2"> <div id="layer3"> ...some code </div> <!--layer3--> <div id="layer4"> ...more code </div> <!--layer4--> </div> <!--layer2--> </div> <!--layer1--> Here is the css: #layer2 { padding:10px 20px 10px; background:url('http://www.tonalproductions.net/test/images/YCC Header.png') left top repeat-x repeat-y; border: 3px solid; border-color: #ffffff; } I've tried it with a background color and a .jpg file but nothing gets rendered. Although IE9 shows it just the way I want it. Any ideas? Thanks. Link to comment https://forums.phpfreaks.com/topic/258788-cant-render-a-background-image/ Share on other sites More sharing options...
sunfighter Posted March 13, 2012 Share Posted March 13, 2012 http://www.tonalproductions.net/test/images/YCC Header.png gives: Not Found The requested URL /test/images/YCC Header.png was not found on this server. ======================= I tried: #layer2 { padding:10px 20px 10px; background-color:green; border: 3px solid; border-color: #ffffff; } and that does work. FireFox Link to comment https://forums.phpfreaks.com/topic/258788-cant-render-a-background-image/#findComment-1326950 Share on other sites More sharing options...
smerny Posted March 13, 2012 Share Posted March 13, 2012 remove the space in the image url... just checked and i see an image that looks appropriate for what you are doing Link to comment https://forums.phpfreaks.com/topic/258788-cant-render-a-background-image/#findComment-1326956 Share on other sites More sharing options...
sunfighter Posted March 14, 2012 Share Posted March 14, 2012 Now that we know where your background image is I ran your code. Here's a problem "repeat-x repeat-y " does not work! Use one or the other, if you need to use both the code is simply repeat. Here's your CSS with border combined: #layer2 { padding:10px 20px 10px; background: url('http://www.tonalproductions.net/test/images/YCCHeader.png') left top repeat; border: 3px solid #ffffff; } Link to comment https://forums.phpfreaks.com/topic/258788-cant-render-a-background-image/#findComment-1327365 Share on other sites More sharing options...
Guber-X Posted March 14, 2012 Share Posted March 14, 2012 you mean this way... http://www.tonalproductions.net/test/images/YCC%20Header.png but the image doesnt appear to be there anyways... but any URLs that have spaces in them should be replaced with "%20" Link to comment https://forums.phpfreaks.com/topic/258788-cant-render-a-background-image/#findComment-1327483 Share on other sites More sharing options...
smerny Posted March 15, 2012 Share Posted March 15, 2012 read previous 2 posts before yours guber Link to comment https://forums.phpfreaks.com/topic/258788-cant-render-a-background-image/#findComment-1327503 Share on other sites More sharing options...
BelowZero Posted March 15, 2012 Author Share Posted March 15, 2012 Thanks sunfighter! The repeat-x repeat-y was the problem. Appreciate your help. Link to comment https://forums.phpfreaks.com/topic/258788-cant-render-a-background-image/#findComment-1327526 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.