It's my understanding that a CSS fixed position element is relative to the viewport only. However, from what I can tell, this is true except that if "left" is unspecified, it doesn't default to 0 but rather to the left edge of what would have otherwise been its container - in this case, the main div. The HTML:
<div id="main">
<div id="fixed"></div>
<div id="content"></div>
</div >
The CSS:
#main{
width:80%;
margin-left:auto;
margin-right:auto;
}
#fixed{
position:fixed;
width:100%;
height:25px;
background:yellow;
}
#content{
width 100%;
height:300px;
background:red
}
demonstrated at http://jsfiddle.net/2dudX/99/ . If I specify left:0 the fixed element will run the width of the screen. What causes this behavior? What are the defaults if I don't specify a left, right, top or bottom?