WordPress.org

Ready to get started?Download WordPress

Forums

Background image attachments: fixed for body only? (5 posts)

  1. MaxwellBalmain
    Member
    Posted 6 years ago #

    Hi all,

    I am working on a mixed static page and WP site. I have attached images using "background-attachment: fixed" to two elements, the body and a header. This works fine for the static pages but only the body element works with the WP page.

    So, I am wondering if "background-attachment: fixed" works for other elements other than the body element in WordPress?

    Thanks!

  2. sasch9r
    Member
    Posted 6 years ago #

    Hm, I havn't tested it yet, but why shouldn't it work? I don't think there's a difference between HTML in a header and in a body ^^

  3. MaxwellBalmain
    Member
    Posted 6 years ago #

    Unfortunately the site is only local on my Mac now. I am not getting the effect on The WP page I am getting on the static pages. Its just an extra flourish. The effect will not work on IE6 as well, which I can live with.

    I was just wondering if this is the case with WP as well before I a move on to other "issues."

  4. Doodlebee
    Member
    Posted 6 years ago #

    Does your header scroll the "fixed" is meant for scrolling things - if your header scrolls, then yes, the background should remain fixed within the header div while the content text scrolls.

    However, if you're wanting your header to sit at the top of your page, and stay there, no matter how far down the page the end user scrolls, you're not looking for "background-attachement:fixed", you're wanting "position:fixed;"

    There's a browser out there that has a problem with this, though - I can't remember if it's Firefox or IE - but you can look at "positioniseverything.net", and I think they have a fix for it there.

  5. MaxwellBalmain
    Member
    Posted 6 years ago #

    Oops!

    This was an error on my part. This confusion had nothing to do with fixed positioning. The problem was that I needed to move my header above the container element to match the markup I had in the static pages. Doing so now makes it work...

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic