1, static (stationary positioning):
The default value. No positioning, elements appear in the normal stream (ignoring top, bottom, left, right, or z-index declarations). Refer to the previous essay.
2, relative (relative positioning):
The element positioned as relative is out of normal text flow, but its position in the text stream still exists, so it is not itself out of the document stream.
The Top,bottom,left,right setting is positioned relative to its normal (original) position. Hierarchical grading can be done through Z-index.
<styletype= "Text/css">. Static1{Height:80px;Background-color:Red; }. Relative{Height:80px;position:relative;Top:40px; Left:40px;Background-color:Black; }. Static2{Height:80px;Background-color:Blue; } </style></Head><Body> <Divclass= "Static1"></Div> <Divclass= "relative"></Div> <Divclass= "Static2"></Div></Body>
Four ways to locate CSS layouts