View Single Post
Old 11-18-2012, 09:34 PM   PM User | #1
freshdude
New Coder

 
Join Date: May 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
freshdude is an unknown quantity at this point
CSS Positioning with Margins

I have my whole site set up to be centered with all elements (position:absolute within this one div:

#website {
position:relative;
margin:0 auto;
width:960px;

How do I add a <div> with a fixed position (stays in the same left and top position as you scroll down) that will be relative to the centered site?

I tried position:fixed; but it just ignores the margins and a left:60px; is always 60px from the left, no matter how wide the browser window.
freshdude is offline   Reply With Quote