WordPress.org

Ready to get started?Download WordPress

Forums

fixed 'wallpaper' or background (7 posts)

  1. pensaro1
    Member
    Posted 4 years ago #

    Hi there, I have been searching for an answer to my question but haven't quite found it exactly. I have WP 2.9.1 and use Magic Blue. I like to change the background from time to time. When I do i'd like to have a fixed background image which stays in place while posts scroll up or down against it. Can anyone point me to the right place? Thanks in advance, pensisto from pensaro.com

  2. tugbucket
    Member
    Posted 4 years ago #

  3. pensaro1
    Member
    Posted 4 years ago #

    Thanks tugbucket. I tried your suggestion. I inserted that piece of code into both css and header.php but the background image is still scrolling with the page. ???

  4. pensaro1
    Member
    Posted 4 years ago #

    Further info in case of other suggestions.
    This is what is in style.css;

    body {
    margin: 0;
    padding: 0;
    color: #333;
    text-align:center;
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 100.1%;
    background: #777;
    }

    and this is what is in header.php;

    body{ background: #fff url("<?php bloginfo('template_directory'); ?>/images/holly2.JPG");

    }
    pensisto.

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 4 years ago #

    technically....you don't even need that line in your header.php unless you really want it there....just a personal thing, but I hate css in a css file and inline in a php file.

    You could delete the line from header.php and in your style.css change
    background: #777;
    to
    background: #777 url('images/holly2.JPG') repeat fixed;

    if you wanna keep it in header.php,
    body{ background: #fff url("<?php bloginfo('template_directory'); ?>/images/holly2.JPG") repeat fixed;

    should work fine. I do know this code works as I copied it from my theme, with a fixed background.

    After you make the changes to any css, press ctrl+f5 while looking at your site to refresh the cache and see changes

    (also, I assumed you wanted your image to tile horizontally and vertically, if not deleted/adjust the repeat)

  6. pensaro1
    Member
    Posted 4 years ago #

    Hi there RVoodo. Thanks for your suggestion. I tried it as you said but the background image is still scrolling with the page. I want the background to remain still while the page scrolls, just as your own site.??? Pensisto.

  7. pensaro1
    Member
    Posted 4 years ago #

    I have solved the problem. I uninstalled and then reinstalled Magic Blue. Then I put in the extra bit about background being fixed and now it is. Don't know why it had to be done that way but at least its done. Thanks for the suggestions. :)

Topic Closed

This topic has been closed to new replies.

About this Topic