Skip to content

Instantly share code, notes, and snippets.

@EE2dev
Last active March 3, 2018 23:36
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 EE2dev/5529ba6e6abd39a1fe6293b22f106222 to your computer and use it in GitHub Desktop.
Save EE2dev/5529ba6e6abd39a1fe6293b22f106222 to your computer and use it in GitHub Desktop.
stacking context
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<style>
.red, .green, .blue {
position: absolute;
width: 100px;
color: white;
line-height: 100px;
text-align: center;
}
.red {
top: 20px;
left: 20px;
background: red;
}
.green {
top: 60px;
left: 60px;
background: green;
}
.blue {
top: 100px;
left: 100px;
background: blue;
}
/*
* {
background: #000 !important;
color: #0f0 !important;
outline: solid #f00 1px !important;
}
*/
</style>
</head>
<body>
<div>
<span class="red">Red</span>
</div>
<div>
<span class="green">Green</span>
</div>
<div>
<span class="blue">Blue</span>
</div>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment