Skip to content

Instantly share code, notes, and snippets.

@zleight1
Created May 14, 2015 18:28
Show Gist options
  • Save zleight1/3a4d51c7ed587520177c to your computer and use it in GitHub Desktop.
Save zleight1/3a4d51c7ed587520177c to your computer and use it in GitHub Desktop.
Floating Example
<html>
<head>
<style>
.red {
background-color: red;
}
.blue {
background-color: blue;
}
div {
display: block;
margin: 10px;
min-height: 50px;
}
.container {
margin: 0 auto;
width: 100%;
padding: 3%;
}
.full {
width: 90%;
clear: both;
}
.half {
width: 45%;
float: left;
}
</style>
</head>
<body>
<div class="container">
<div class="full red"></div>
<div class="half red"></div>
<div class="half blue"></div>
<div class="full blue"></div>
</div>
</body>
</html>
@SharpProgrammer
Copy link

Thanks this is exactly what I was looking for. Looks like the width percentages and flow is what controls the row each div is on. Breaking the float after each longer one and allowing the shorter ones to stack one after the other on the row

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment