Skip to content

Instantly share code, notes, and snippets.

@andrewdh
Created July 18, 2012 11:27
Show Gist options
  • Save andrewdh/3135694 to your computer and use it in GitHub Desktop.
Save andrewdh/3135694 to your computer and use it in GitHub Desktop.
Fluid column layout with fixed pixel margins between them.
/**
* Fluid column layout with fixed pixel margins between them.
*/
.container {
width:50%;
height:10em;
padding-left:20px
}
.box {
height:100%;
width:33.33%;
float:left;
}
.first {
margin-left:-20px;
margin-right:10px;
background-color:hsla(20, 80%, 55%, 1);
}
.second {
margin-right:10px;
background-color:hsla(140, 80%, 55%, 1);
}
.last {
background-color:hsla(260, 80%, 55%, 1);
}
<div class="container">
<div class="box first">Column 1</div>
<div class="box second">Column 2</div>
<div class="box last">Column 3</div>
</div>
{"view":"split","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