Help Aligning Sidebar! Please

Discussion in 'CSS' started by tobydawson13, Nov 18, 2008.

  1. #1
    Hi
    On my website http://betabux.com/ i have a problem.
    The sidebar on the right, with the 150 x 36 px banner adverts.
    Dis-aligns (if that's a word?), when the browser is resized.

    I have a feeling this can be prevented with CSS, can anybody improve on the code I currently have.

    #right_sidebar{top:209px;left:1046px;text-align:right;position:absolute}
    Code (markup):
    Thankyou for your help :)
     
    tobydawson13, Nov 18, 2008 IP
  2. Pandemix

    Pandemix Well-Known Member

    Messages:
    954
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    120
    #2
    You should really use floats instead of absolute positioning.
     
    Pandemix, Nov 18, 2008 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Agreed. You've removed the thing from the flow of the document with absolute positioning.

    However, if you are hell-bent on keeping it, you could position it from the right rather than the left. Like
    right: 0;
    it will hug the right side of anyone's screen, meaning if the browser window gets smaller, it'll move with the right side.

    Problem you'll have then is that it will slide right over all the other content on the page.

    Absolute positioning-- use it only when you absolutely must.
     
    Stomme poes, Nov 20, 2008 IP
    Pandemix likes this.