Skip to content

Instantly share code, notes, and snippets.

@kunigami
Created January 20, 2018 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunigami/d67a612b7af277a700d044c9a2e4b978 to your computer and use it in GitHub Desktop.
Save kunigami/d67a612b7af277a700d044c9a2e4b978 to your computer and use it in GitHub Desktop.
.box {
height: 100px;
width: 100px;
}
.root_stacking_context {
border: 1px solid;
height: 300px;
width: 300px;
}
.stack_context_negative_index {
z-index: -1;
background-color: red;
height: 200px;
position: absolute;
text-align: right;
top: 15px;
left: 45px;
}
.non_positioned.non_inline {
background-color: green;
top: 30px;
left: 30px;
margin-bottom: -50px;
}
.non_positioned_float {
float: left;
background-color: cyan;
margin-left: 15px;
}
.non_positioned.inline {
background-color: orange;
display: inline-block;
margin-left: -35px;
margin-top: 15px;
}
.stack_context_positive_index {
z-index: 1;
background-color: yellow;
position: absolute;
top: 100px;
left: 60px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment