Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS Positioning and Browser Window Scaling

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #27666
    robst
    Member

    Hey Everyone,

    I’m having a little struggle with CSS positioning in particular when I resize my browser window. I’ve placed a background image in the upper right corner with fixed positioning. It looks as it should, but when I resize the browser window, the background image moves as I resize the browser window. Of course I don’t want that….I want the image to stay in place no matter what.

    Do any of you have any suggestions? At first, I thought about putting this background image within another containing div element…but I’m having a problem visualizing how that would fix this. I guess it was my understanding that when you place a background image using fixed positioning, the image does not move upon browser window scaling.

    Here’s my CSS for the body:

    body{
    margin:0;
    padding:0;
    -moz-background-clip:border;
    -moz-background-inline-policy:continuous;
    -moz-background-origin:padding;
    background: #7e9297 url(images/bg.jpg);
    background-attachment:fixed;
    background-position:top right;
    background-repeat:no-repeat;
    }

    Thanks for reading,

    ;) Rob

    #78404
    robst
    Member

    hmmm, ok! So….I tried putting this BG image within another wrapper div which was set to 100% width (see above CSS for how I’m positioning this image). Unfortunately, that did not work.

    I’m wondering if there needs to be a wrapper/container div and then two more divs set to different widths….then maybe I’d place the BG image in the right floated div?

    I’m running out of ideas here to keep this background image from moving as the viewer resizes their browser window.

    #78405
    Rob MacKay
    Participant

    bit of a plug… but I hope it will help lol

    http://alteredaspect.info/the-art-of-css-positioning/

    #78331
    robst
    Member

    :) Thanks Rob! I’ll check this article out this afternoon. It could be the answer to all this browser scale mess.

    #75888
    thokie
    Member

    Thanks Rob!!! big help…..

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘CSS’ is closed to new topics and replies.