Skip to content

Instantly share code, notes, and snippets.

@gonghao
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save gonghao/437415c05de5cd7b54bc to your computer and use it in GitHub Desktop.

Select an option

Save gonghao/437415c05de5cd7b54bc to your computer and use it in GitHub Desktop.
Untitled
h2 {
font-size: 22px;
}
.inline-block {
font-size: 0;
}
.inline-block > span {
font-size: 14px;
display: inline-block;
width: 200px;
padding: 20px;
background: #ccc;
}
.float-block {
font-size: 14px;
overflow: hidden;
}
.float-block > div {
width: 200px;
padding: 20px;
background: #ccc;
float: left;
}
<div class="inline-block">
<h2>Inline-Block</h2>
<span>1</span>
<span>2</span>
<span>3</span>
</div>
<div class="float-block">
<h2>Float Block</h2>
<div>1</div>
<div>2</div>
<div>3</div>
</div>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment