CSS element level

Use the default element position: static.

After using the position not use the default value of the positioning will affect the normal flow of the document,

As the parent element will look absolute positioning, fixed to the viewport based positioning,

In this case, each element of the hierarchy:

1. sibling element, after the element hierarchy levels will be higher than before.

2. The father and son element, sub-element level will be higher than the parent element level.

 

Want to change the hierarchy, using the z-index, sibling elements in the higher z-index greater level.

Z-index but does not affect the parent-child element, the parent element to increase the z-index value can not be higher than the level of sub-elements.

Attach an example:

sibling elements for the child 1,2,3,4 successively arranged, child5 as child elements of child4.

Jsbin address

 

 

 

 

Guess you like

Origin www.cnblogs.com/bzwhvlife/p/11665892.html