Skip to content

Instantly share code, notes, and snippets.

@jdivock
Created August 9, 2015 21:04
Show Gist options
  • Save jdivock/ce589c49c07f1870d665 to your computer and use it in GitHub Desktop.
Save jdivock/ce589c49c07f1870d665 to your computer and use it in GitHub Desktop.
3Col CSS basic
<html>
<head>
<style>
header {
height: 30px;
background: red;
}
article {
margin-left: 150px;
margin-right: 250px;
}
.col {
position: relative;
float:left;
}
.middle-col {
width: 100%;
background: pink;
}
.left-col {
margin-left: -100%;
height: 300px;
right: 150px;
width: 150px;
background: orange;
}
.right-col {
margin-right: -100%;
width: 250px;
background: yellow;
}
footer {
clear: both;
height: 50px;
background: blue;
}
</style>
</head>
<body>
<header>
Imma header
</header>
<article>
<section class="middle-col col">
middle
</section>
<section class="left-col col">
left
</section>
<section class="right-col col">
right
</section>
</article>
<footer>
Imma footer
</footer>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment