According to the spec[1], using position: fixed is *always* relative  
to the viewport, unlike absolute positioning, which is relative to a  
relatively or absolutely positioned containing block or, that  
failing, the viewport.

Fixed positioning is like this because the element is positioned in a  
specific place on the screen—other boxes have no effect on it.

I'm wondering if you perhaps want absolute position instead of fixed.  
With the code you supply, page does very odd things when the window  
scrolls.

[1]: http://www.w3.org/TR/REC-CSS2/visuren.html#fixed-positioning  
"Visual formatting model"
-- 
Ryan

http://RyanCannon.com/



On 19 May 2006, at 5:53 PM, [EMAIL PROTECTED] wrote:

> I have a #wrapper container that's 700px wide and centered with  
> margin:0
> auto.  I want a sidebar that is "position:fixed" and flush left and  
> top
> to the container - not the browser window.  Amazingly, I've actually
> gotten this under control in IE, and, of course, works fine in Mozilla
> (had to add "margin: 0 auto" to the #sidebar  to get it in there,  
> but it
> worked for some reason!).  However, in Opera , it *literally* centers
> the #sidebar in the browser window.
>
> My #wrapper container centers itself just fine (I also have it
> relatively positioned for IE purposes to emulate the fixed  
> positioning),
> but I cannot seem to get Opera to set the #sidebar to the left of the
> #wrapper and not the browser window.
>
> Is this a bug?  Or am I missing something completely?  Would anyone  
> know
> how I could get that #sidebar to flush left of the #wrapper and not  
> the
> browser window itself?  I'd really appreciate any advice :)
>
> Oh, and if it helps...
>
> #wrapper {
>                 position:relative;
>                 width:700px;
>                 height:18em;
>                 margin:10px auto;
>                 border:1px solid #000;
>                 background-color:#EEE;
>                 color:#000;}
>
> #sidebar {
>                 width:100px;
>                 height:18em;
>                 background-color:#CCC;
>                 color:#FFF;
>                 position:fixed;
>                 margin:0 auto; /* this, for some reason, makes Firefox
> position it where I want to.  If I take it out, then the sidebar does
> the same thing Opera does.  If a leave it in, Opera centers the  
> sidebar
> in the browser window, overlapping the #wrapper div*/}
>
> Thanks!
>
> ~Shelly

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to