Created
August 5, 2014 00:57
-
-
Save trongthanh/e7a19e36b908afa3e655 to your computer and use it in GitHub Desktop.
Position Property & Positioning Context Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Position Property & Positioning Context Demo | |
*/ | |
div { | |
padding: 10px; | |
/*NOTE: box-sizing is natural (content-box)*/ | |
} | |
.main { | |
width: auto; | |
border: 5px solid lightgreen; | |
background-color: AliceBlue; | |
} | |
.box { | |
width: 200px; height: 100px; | |
border: 2px dashed hsla(25, 75%, 20%, 0.8); | |
background: hsla(25, 75%, 47%, 0.7); | |
/*position: absolute;*/ | |
} | |
.box-child { | |
width: 50px; height: 50px; | |
background: hsla(10, 75%, 47%, 0.5); | |
/*position: absolute;*/ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Position Property & Positioning Contexts</h1> | |
<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> | |
Lorem ipsum dolor sit amet, consectetur adipisicing elit. | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// alert('Hello world!'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"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