Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.