globalnerds Posted May 14, 2013 Share Posted May 14, 2013 I am php newibe but not a CSS newbie. Here is my css code: wrap { background: url("images/backgrounds/bg-wrap.png") repeat-x scroll 0 295px transparent; margin: 0; padding: 0; width: 100%; } The image exists in this location and when I inspect it in firefox I can hover over the CSS and see it. I cannot get it to display. Here is my php code: <wrap> <div class="wrap"> <?php $a = new Area('Wrap'); $a->display($c); ?> </div> </wrap> What am I doing wrong, I just want the image to display behind the body but above the footer. Here is the website: http://carolinestreetptso.org/play/ Thanks in advance Gary Global Nerds Quote Link to comment https://forums.phpfreaks.com/topic/277992-background-image-not-showing/ Share on other sites More sharing options...
Jessica Posted May 14, 2013 Share Posted May 14, 2013 If that's all your code, then $c is undefined. Quote Link to comment https://forums.phpfreaks.com/topic/277992-background-image-not-showing/#findComment-1430048 Share on other sites More sharing options...
requinix Posted May 14, 2013 Share Posted May 14, 2013 wrap { ? Quote Link to comment https://forums.phpfreaks.com/topic/277992-background-image-not-showing/#findComment-1430049 Share on other sites More sharing options...
globalnerds Posted May 14, 2013 Author Share Posted May 14, 2013 What code would you use to just display the image? Quote Link to comment https://forums.phpfreaks.com/topic/277992-background-image-not-showing/#findComment-1430057 Share on other sites More sharing options...
blackholesun Posted May 14, 2013 Share Posted May 14, 2013 I am php newibe but not a CSS newbie. Here is my css code: wrap { background: url("images/backgrounds/bg-wrap.png") repeat-x scroll 0 295px transparent; margin: 0; padding: 0; width: 100%; } The image exists in this location and when I inspect it in firefox I can hover over the CSS and see it. I cannot get it to display. Here is my php code: <wrap> <div class="wrap"> <?php $a = new Area('Wrap'); $a->display($c); ?> </div> </wrap> What am I doing wrong, I just want the image to display behind the body but above the footer. Here is the website: http://carolinestreetptso.org/play/ Thanks in advance Gary Global Nerds Not sure how relevant this is but looking at the css you have supplied, wouldn't you be refering that by id in the html? (i.e. <div id="wrap">). As far as i know with css, classes are preceded by a period, in which case the css would look more like: .wrap { background: url("images/backgrounds/bg-wrap.png") repeat-x scroll 0 295px transparent; margin: 0; padding: 0; width: 100%; } ..which you would then be able to refer to in the html: <div class="wrap">... I'm probably wrong but from my limited experience that's how things seem to be done... Quote Link to comment https://forums.phpfreaks.com/topic/277992-background-image-not-showing/#findComment-1430064 Share on other sites More sharing options...
Q695 Posted May 15, 2013 Share Posted May 15, 2013 What is $c? Quote Link to comment https://forums.phpfreaks.com/topic/277992-background-image-not-showing/#findComment-1430120 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.