Positioning Elements by
Case2: 2 columns layout
Relative and Absolute
Positioning of Elements
Case1: Relative Positioning
Case2: Absolute Positioning
Find the nearest relative/absolute positioning ancestor as offset basis
The html tag by default is set to relative positioning
In this case, the div tag isn't set with positioning type, so is the body tag, so the offset basis
is actually the html tag.
Offsetting the relative container makes its content offset as well.
Back to main page