9.Css-- positioning

Css Positioning

 

1.position:

static

The default value is not located

fixex

Fixed position, when there is a scroll bar with the scroll object does not

relative

Relative positioning of the elements will move in accordance with the original position of the element

abosolute

After the absolute positioning, the position is set to absolute, the element is arranged to be defined within the specified containing element

Coordinates (x coordinate, y coordinate}, absolute positioning element relative nearest positioned parent element, if the element is not set

Bits parent element, its position relative to the <html>.

Specific usage: position: xx

2.z-index:

A large number of rules to follow that is closer to the user, the code shown below position1 and position2 represent different blocks of two colors, because position1 is written z-index: 2, therefore this box where the user position1 closer that covers the other block, above.

Published 29 original articles · won praise 17 · views 391

Guess you like

Origin blog.csdn.net/weixin_46319702/article/details/105078371