Jump to content

Background image not showing


globalnerds

Recommended Posts

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

 

Link to comment
https://forums.phpfreaks.com/topic/277992-background-image-not-showing/
Share on other sites

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... :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.