Last active
August 29, 2015 14:03
-
-
Save trongthanh/ac43700798d06042f751 to your computer and use it in GitHub Desktop.
Clear Fix 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
/** | |
* Clear Fix Demo | |
*/ | |
html { | |
font-family: sans-serif; | |
font-size: 150%; | |
} | |
.container { | |
background: #aaddaa; | |
} | |
.float { | |
border: 1px solid red; | |
width: 30%; | |
padding: 0.5em; | |
text-align: center; | |
color: blue; | |
background: #ffeeee; | |
margin: 10px; | |
float: left; | |
} | |
.box3 { | |
/*clear: both;*/ | |
} | |
/*method 1*/ | |
br.clear { | |
clear: both; | |
} | |
/*method 2*/ | |
.container { | |
/*overflow: auto;*/ | |
} | |
/*method 3*/ | |
.clearfix:after { | |
content: ''; | |
clear: both; | |
display: block; | |
} | |
/*Bullet-proof hack: http://nicolasgallagher.com/micro-clearfix-hack/*/ |
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
<div class="container"> | |
<div class="float box1">1</div> | |
<div class="float box2">2</div> | |
<div class="float box3">3</div> | |
<div class="float box4">4</div> | |
<p>Content inside</p> | |
</div> | |
Content below |
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":"110","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment