-
-
Save Kevnz/964117 to your computer and use it in GitHub Desktop.
A simple, small, and powerful CSS Grid System (based on YUI 3 CSS Grids)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Based on YUI 3 CSS Grids: http://developer.yahoo.com/yui/3/cssgrids/ */ | |
.layout { | |
letter-spacing: -0.31em; /* webkit: collapse white-space between units */ | |
*letter-spacing: normal; /* reset IE < 8 */ | |
word-spacing: -0.43em; /* IE < 8 && gecko: collapse white-space between units */ | |
} | |
.layout > *, | |
.layout .unit { | |
display: inline-block; | |
zoom: 1; *display: inline; /* IE < 8: fake inline-block */ | |
letter-spacing: normal; | |
word-spacing: normal; | |
vertical-align: top; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Example</title> | |
<style> | |
/* Based on YUI 3 CSS Grids: http://developer.yahoo.com/yui/3/cssgrids/ */ | |
.layout { | |
letter-spacing: -0.31em; /* webkit: collapse white-space between units */ | |
*letter-spacing: normal; /* reset IE < 8 */ | |
word-spacing: -0.43em; /* IE < 8 && gecko: collapse white-space between units */ | |
} | |
.layout > *, | |
.layout .unit { | |
display: inline-block; | |
zoom: 1; *display: inline; /* IE < 8: fake inline-block */ | |
letter-spacing: normal; | |
word-spacing: normal; | |
vertical-align: top; | |
} | |
#header, #footer { display: block; } | |
#content { | |
width: 70%; | |
direction: rtl; | |
} | |
#main, #nav { direction: ltr; } | |
#main { width: 75%; } | |
#nav { width: 25%; } | |
#sidebar { width: 30%; } | |
</style> | |
</head> | |
<body class="layout"> | |
<div id="header"> | |
<h1>Example</h1> | |
</div> | |
<div id="content"> | |
<div class="layout"> | |
<div id="main"> | |
<h3>Main Content</h3> | |
</div> | |
<div id="nav"> | |
<ul> | |
<li><a href="#main">Main</a></li> | |
<li><a href="#sidebar">Sidebar</a></li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
<div id="sidebar"> | |
<h3>Sidebar</h3> | |
<p>Sidebar’s content…</p> | |
</div> | |
<div id="footer"> | |
<p>footer content…</p> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment