Skip to content

Instantly share code, notes, and snippets.

@tinogomes
Forked from anonymous/dabblet.css
Created March 6, 2013 12:56
Show Gist options
  • Save tinogomes/5099143 to your computer and use it in GitHub Desktop.
Save tinogomes/5099143 to your computer and use it in GitHub Desktop.
estudos CSS: float vs overflow
.container {
background: #CCC;
box-model: box-sizing;
}
#container-float {
float: left;
}
#container-overflow {
overflow: hidden;
}
#first {
background: red;
min-height: 100px;
}
#last {
background: yellow;
min-height: 250px;
}
.box {
float: left;
width: 200px
}
<div class="container" id="container-overflow">
<h1>container-overflow</h1>
<div class="box" id="first">lorem ipsum</div>
<div class="box" id="last">another</div>
</div>
<br>
<div class="container" id="container-float">
<h1>container-float</h1>
<div class="box" id="first">lorem ipsum</div>
<div class="box" id="last">another</div>
</div>
<div style="clear:both;">
lorem
</div>
// alert('Hello world!');
{"view":"separate","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