CSS z-index attribute and cssz-index attribute

Source: Internet
Author: User

CSS z-index attribute and cssz-index attribute
Stack context: 3D concept, indicating the position of an element on the Z axis

Layers can be nested and combined into a hierarchical Context
Each cascade context and sibling element are independent. When performing cascade change or rendering, only descendant elements are considered.
Each stack is self-contained

Cascade order
1 background ~ Border2 negative z-index3 block box 4 float floating box 5 inline/inline-block box 6 z-index: auto/z-index: 07 positive z-index
Features

Negative value supported
SupportedCSS3Animation
Css2.1 needs to be used with positioning Elements
Such as positioning ElementZ-indexNesting: the principle of "back-to-back ".
If nesting occurs: The ancestor priority principle and premiseZ-indexIs a value rather than a valueAuto,AutoDo not create stack Context

Application

Default positioning ElementZ-index: auto;/z-index: 0
Z-indexNotAutoTo create a layered context.
Z-indexCascade order comparison stops at parent-level Cascade Context
AvoidZ-indexChaotic nested hierarchical relationships
AvoidZ-indexChaos, a flash of style problems higher than a mountain
Negative values can be used for hiding

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.