WebCheez Posted May 29, 2011 Share Posted May 29, 2011 The following displays no image: body { background-color: #000000; background-image: url('code.gif'); background-repeat:no-repeat; } I made sure that code.gif exists, so what's going on here?? Link to comment https://forums.phpfreaks.com/topic/237738-background-image/ Share on other sites More sharing options...
cssfreakie Posted May 29, 2011 Share Posted May 29, 2011 it looks valid, But the point is, where is that image? in the same folder as the style sheet? We can't see the context here. So if you have an online example i am pretty sure to find the problem. it could also be: background-image: url('../code.gif'); or background-image: url('../images/code.gif'); Link to comment https://forums.phpfreaks.com/topic/237738-background-image/#findComment-1221732 Share on other sites More sharing options...
floridaflatlander Posted May 29, 2011 Share Posted May 29, 2011 double check your image path. The way it is now, it should be in the same folder as the file whose body your trying to style with the above code Link to comment https://forums.phpfreaks.com/topic/237738-background-image/#findComment-1221733 Share on other sites More sharing options...
WebCheez Posted May 29, 2011 Author Share Posted May 29, 2011 Oh, looks like the .gif extension was capitalized so it was .GIF. I got it to work. Link to comment https://forums.phpfreaks.com/topic/237738-background-image/#findComment-1221735 Share on other sites More sharing options...
cssfreakie Posted May 29, 2011 Share Posted May 29, 2011 nice one, you might also want to consider writing shorthand css body{ background:#000 url(code.gif) no-repeat; } Link to comment https://forums.phpfreaks.com/topic/237738-background-image/#findComment-1221736 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.