Skip to content

Instantly share code, notes, and snippets.

@plugn
Last active March 10, 2017 13:10
Show Gist options
  • Save plugn/c97c3e880b92378893396ddde600b023 to your computer and use it in GitHub Desktop.
Save plugn/c97c3e880b92378893396ddde600b023 to your computer and use it in GitHub Desktop.
float grid 3 col layout // source https://jsbin.com/veriva
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.clearfix::after {
display: table;
content: "";
clear: both;
}
.col {
width: 70px;
border: 1px dashed blue;
min-height: 80px;
padding: 5px;
}
.col.left {
float: left;
}
.col.right {
float: right;
}
.main {
background-color: #ddd;
margin: 0 90px;
width: auto;
}
.container {
width: 350px;
border: 1px solid pink;
}
</style>
</head>
<body>
<div class="container clearfix">
<div class="col left">
left
</div>
<div class="col right">
right
</div>
<div class="col main">
main
</div>
<script id="jsbin-source-css" type="text/css">.clearfix::after {
display: table;
content: "";
clear: both;
}
.col {
width: 70px;
border: 1px dashed blue;
min-height: 80px;
padding: 5px;
}
.col.left {
float: left;
}
.col.right {
float: right;
}
.main {
background-color: #ddd;
margin: 0 90px;
width: auto;
}
.container {
width: 350px;
border: 1px solid pink;
}
</script>
</body>
</html>
.clearfix::after {
display: table;
content: "";
clear: both;
}
.col {
width: 70px;
border: 1px dashed blue;
min-height: 80px;
padding: 5px;
}
.col.left {
float: left;
}
.col.right {
float: right;
}
.main {
background-color: #ddd;
margin: 0 90px;
width: auto;
}
.container {
width: 350px;
border: 1px solid pink;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment