Posts

Showing posts with the label Nested

CSS: Position:fixed Inside Of Position: Fixed

Answer : The fixing and the positioning are two separate things. They're positioned the same as absolutely positioned elements: relative to their containing block. But in contrast with absolutely positioned elements, they remain fixed to that position with respect to the viewport (i.e. they don't move when scrolling): http://www.w3.org/TR/CSS2/visuren.html#propdef-position The box's position is calculated according to the 'absolute' model, but in addition, the box is fixed with respect to some reference. Positioning The definition of containing block says: If the element has 'position: fixed', the containing block is established by the viewport in the case of continuous media (...) and If the element has 'position: absolute', the containing block is established by the nearest ancestor with a 'position' of 'absolute', 'relative' or 'fixed' (...) which suggests that while their positioning algorithm is the same (they...