This chapter summarizes all Positioning
I. Align left
Center block elements
Invalid inline Element
① Align the content left and assign the text-align: left value to the block element, because the inline element contains the content size.
② Set the size of the left-aligned element magin-left: 0 align it left, use margin-right: auto to block its right alignment, for absolute positioning elements, use left: 0 left alignment, right: auto to prevent it from right alignment
③ To create a left-aligned and stretched element, you can use width: auto, margin-left: 0, margin-right: 0 to stretch its width to the left and right. For an absolute element, you can use left: 0 and right: 0 to stretch it to the left and right sides.
④ Create a left-aligned package element left: 0 or margin-left: 0
Note: IE6 does not support stretching.
2. Left offset
Margin-left: positive value offset to the right negative value offset to the left
3. Right alignment
Align with left
4. Right offset
Offset from the left
5. Center alignment
Content center alignment text-align: center
Center-aligned left: 0px; right: 0px; margin-left: auto; margin-right: auto