Skip to content

Instantly share code, notes, and snippets.

@trongthanh
Created August 3, 2014 05:22
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 trongthanh/cdb91ecad3aa2fe1d3d6 to your computer and use it in GitHub Desktop.
Save trongthanh/cdb91ecad3aa2fe1d3d6 to your computer and use it in GitHub Desktop.
Position Property & Positioning Context Demo
/**
* Position Property & Positioning Context Demo
*/
div {
padding: 10px;
}
.main {
width: auto;
border: 5px solid lightgreen;
background-color: AliceBlue;
/*position: relative;*/
}
.box {
width: 150px; height: 150px;
border: 1px dashed black;
background: hsla(25, 75%, 47%, 0.7);
/*position: relative;*/
}
.box-child {
width: 40%; height: 40%;
background: hsla(10, 75%, 47%, 0.5);
/*position: absolute;*/
}
.popup {
background: hsla(225, 75%, 47%, 0.7);
width: 40%; height: 100px;
position: fixed;
top: 20%; left: 20%;
z-index: 1;
}
<div class="main">
<strong>.main</strong>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias mollitia maxime aut minima quidem voluptatibus animi quo, in iste, pariatur eveniet sequi explicabo necessitatibus, nihil quasi. Unde, numquam dignissimos reiciendis.
<div class="box">
.box
<div class="box-child">
.box-child
</div>
</div>
</div>
// alert('Hello world!');
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment