Skip to content

Instantly share code, notes, and snippets.

@andyr
Created February 12, 2014 01:08
Show Gist options
  • Save andyr/8947942 to your computer and use it in GitHub Desktop.
Save andyr/8947942 to your computer and use it in GitHub Desktop.
Example flexible 3-column CSS layout. Compatible with old browsers.
.col {
border: 1px solid;
margin: 0;
padding: 5px;
}
.a {
width: 100px;
float: left;
border-color: blue;
}
.b {
border-color: red;
margin: 0 120px 0 120px;
}
.c {
width: 100px;
border-color: green;
float: right;
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<link rel="stylesheet" href="flex-middle.css" />
</head>
<body>
<div class="col a">fixed 100px</div>
<div class="col c">fixed 100px</div>
<div class="col b">flexible space</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment