WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Keeping my background from scrolling. (8 posts)

  1. Resobaso
    Member
    Posted 1 year ago #

    Trying to keep my background from scrolling, tried setting a size to it but the site frequently changes based on the type of content. So that hasn't been working. Any chance of some help?

    #art-page-background-simple-gradient {
    background-image:url(images/newbackground.png);
    background-repeat:repeat;
    background-attachment:inherit;
    background-position:center;
    height:900%;
    position:absolute;
    top:0;
    width:100%;
  2. Resobaso
    Member
    Posted 1 year ago #

    To put simply, I want the background to be locked in place so when I scroll the background doesnt.

  3. ronangelo
    Member
    Posted 1 year ago #

    background-attachment: fixed;
  4. Resobaso
    Member
    Posted 1 year ago #

    Problem with that is that the background still scrolls.

    I simply want it locked. Example.

    http://www.spoonyexperiment.com

    unless this is a different case.

  5. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    That's the correct code, but perhaps you are not applying to the correct element on the page. Unless you post a link to your site, no way to help with that. This may be helpful as to the correct CSS code:

    http://www.w3schools.com/cssref/pr_background-attachment.asp

  6. Resobaso
    Member
    Posted 1 year ago #

  7. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    You need to apply all those background styles to your body tag - not to a separate div.

  8. Stacey@crazydoglife
    Member
    Posted 1 year ago #

    This should take care of it.

    body {
    background-attachment:fixed;
    background-image:url("xxxxxxxx");
    background-position:center top;
    repeat:no repeat;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic