Okay, I've noticed something, but couldn't find it in the CSS spec. Styling an element with position: fixed will position it absolutely, with respect to the browser viewport. What happens if you place a fixed-position element inside another?
Example CSS along the lines of:
.fixed {
position: fixed;
width: 100px;
height: 100px;
background: red;
}
#parent {
right 100px;
padding: 40px;
}
.fixed .fixed {
background: blue;
}
<div id="parent" class="fixed">
<div class="fixed"> </div>
</div>
As far as I can tell, the element is fixed-positioned with respect to its nearest parent that's also fixed-positioned. Is this observable in all browsers; also, is it a bug, or intentional behaviour?
So far I've not found anything on this topic, just 'fixed position makes it stick to the page'.