Skip to content

Commit

Permalink
please work
Browse files Browse the repository at this point in the history
  • Loading branch information
Lily Pashapour authored and Lily Pashapour committed Apr 16, 2019
1 parent 2bed6aa commit b802ec5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 03 - CSS/describe-z-index-and-how-stacking-context-is-formed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Z-Index and How Stacking Context is Formed
The z-index CSS property sets the z-order of a positioned element and its descendants or flex items. Overlapping elements with a larger z-index cover those with a smaller one. Z-index only works with elements that have positions set to something other than static. It moves elements within the stacking context.

The stacking context is a three-dimensional conceptualization of HTML elements along imaginary z-axis relative to the user, who is assumed to be facing the viewport or the webpage. HTML elements occupy this space in priority order based on element attributes. The stacking context is formed by the existence of any element that falls into specific scarios such as:

* Being the root element of the document `<html>`
* It `position` value is `absolute`, `fixed`, `sticky`, or `relative` and the `z-index` value is other than `auto`.
* It has an `opacity` value less than `1`.
* If any of the following properties have a value other than none:
** `transform`
** `filter`
** `perspective`
** `clip-path`
** `mask` / `mask-image` / `mask-border`

0 comments on commit b802ec5

Please sign in to comment.