WordPress.org

Ready to get started?Download WordPress

Forums

Possible to add two images to the background? (4 posts)

  1. Zyk
    Member
    Posted 5 years ago #

    I have a background image that repeats across the top of the page, I am wanting to add one to the bottom of the page as well. My current css is:

    body {
    background:#E5E5E5 url(img/bg.png) repeat-x;
    }

    What would I add if my bottom image was at url (img/bgb.png)?

    Thanks for any help!

  2. stvwlf
    Member
    Posted 5 years ago #

    Attach that image as background image to another DIV on your site. Use the footer DIV if that works for you (it probably won't go all the way across the page) or add another DIV below the footer DIV if you need to. Add it to footer.php.

    Set the containing div's height and width to that of the image.

  3. Zyk
    Member
    Posted 5 years ago #

    Thanks for the idea.

    What specifically should I add in the footer.php file? I tried css similar to above but it did not work.

    Thanks for any suggestions.

  4. stvwlf
    Member
    Posted 5 years ago #

    add to footer.php:
    <div id="bottom_image></div>

    You want to put this after the existing footer has been output and before closing Div's

    add to css:

    #bottom_image {
       height:  75px;
       width: 750px;
       background: url(images/myimage.jpg) no-repeat;
    }

    Your issue is gonna be getting it to display in the right place on the page. If it is in the wrong place, try adding clear: both; to #bottom_image and if that doesn't work try adding float:left;

    If that doesn't work, move the location of <div id="bottom_image></div> in your footer file, trying it after different closing</div> tags. The trick is finding the right location to put the code.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags