Skip to content

Instantly share code, notes, and snippets.

@trongthanh
Created July 5, 2014 04:08
Show Gist options
  • Save trongthanh/796fd47149690862da4b to your computer and use it in GitHub Desktop.
Save trongthanh/796fd47149690862da4b to your computer and use it in GitHub Desktop.
Float Demo
/**
* Float Demo
*/
html {
font-family: sans-serif;
font-size: 150%;
color: #666;
}
.container {
border: 1px solid #ccc;
}
p {
border: 1px solid black;
}
.float {
border: 1px solid red;
width: 130px;
height: 70px;
text-align: center;
color: blue;
background: #ffeeee;
float: right; /* implicit display: block*/
}
.box1 {
float: left;
}
.box2 {}
.box3 {}
.box4 {}
.p1 {}
.p2 {}
<div class="container">
<span class="float box1">1</span>
<p class="p1">P1 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat.</p>
<div class="float box2">2</div><div class="float box3">3</div><div class="float box4">4</div>
<p class="p2">P2 duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
// alert('Hello world!');
{"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