Skip to content

Instantly share code, notes, and snippets.

@xeoncross
Created October 8, 2011 16:46
Show Gist options
  • Save xeoncross/1272529 to your computer and use it in GitHub Desktop.
Save xeoncross/1272529 to your computer and use it in GitHub Desktop.
IE7+ Classes CSS grid with margin support
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Demo</title>
<style>
#main{margin:0 auto; width:950px; background-color:#0000FF}
div {float:left; width:70px; height:70px; background-color:red;}
div + div { float:left; margin-left: 10px; width:70px; height:70px; background-color:red;}
</style>
</head>
<body>
<div id="main">
<!-- http://forrst.com/posts/A_quickie-PCT -->
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment