Skip to content

Instantly share code, notes, and snippets.

@CrowderSoup
Created June 25, 2012 17:55
Show Gist options
  • Select an option

  • Save CrowderSoup/2990202 to your computer and use it in GitHub Desktop.

Select an option

Save CrowderSoup/2990202 to your computer and use it in GitHub Desktop.
Basic 3-col CSS Grid
/**
* This is the most simple 3-col CSS grid I could imagine. It supports 3 columns of equal size with 10px margins. Feel free to modify this as
* you need.
*/
/**
* The row
*/
.row { clear: both; overflow: hidden; margin: 0 0 10px 0; }
/**
* The column
*/
.col { float: left; width: 31%; margin: 10px 10px 10px 10px; }
<!DOCTYPE html>
<html>
<head>
<title>Basic 3-Col CSS Grid</title>
<link rel="3colgrid.css" />
</head>
<body>
<div class="row">
<div class="col">Col 1</div>
<div class="col">Col 2</div>
<div class="col">Col 3</div>
</div>
<div class="row">
<div class="col">Col 4</div>
<div class="col">Col 5</div>
<div class="col">Col 6</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment