Layout model (1), layout model (
First, we will understand what contains blocks. css inclusion blocks are an important concept in the standard css layout and are the basis for absolute positioning. The inclusion block is a reference object that provides the coordinate offset and display range for the absolute positioning element, that is, a reference for determining the absolute positioning offset start point and percentage length.
Due to some problems in parsing multi-layer inclusion in IE browser, only when the absolutely positioned element has layer features can it be accurately parsed. layer features should include: width: 100px; height: 100px; position:
For example:
Div id = "div1">
CSS:
# Div1 {position: relative; background: blue;/* height: 200px; width: 200px; ie6 can be properly parsed only after the width and height are added */} # div2 {position: absolute; width: 100px; height: 100px; background: red; left: 50%; top: 50% ;}