Skip to content

Instantly share code, notes, and snippets.

@roachhd
Forked from anonymous/jsbin.AYEpIlAw.html
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roachhd/8746870 to your computer and use it in GitHub Desktop.
Save roachhd/8746870 to your computer and use it in GitHub Desktop.
simple colums using pureCSS YUI. standard and responsive versions.
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.3.0/pure-min.css">
<title>JS Bin</title>
</head>
<body>
<div class="container">
<h1>Standard Grid</h1>
<div class="pure-g">
<div class="pure-u-1-4">Column 1</div>
<div class="pure-u-1-4">Column 2</div>
<div class="pure-u-1-4">Column 3</div>
<div class="pure-u-1-4">Column 4</div>
</div>
</div>
<div class="container">
<h1>Responsive Grid</h1>
<div class="pure-g-r">
<div class="pure-u-1-4">Column 1</div>
<div class="pure-u-1-4">Column 2</div>
<div class="pure-u-1-4">Column 3</div>
<div class="pure-u-1-4">Column 4</div>
</div>
</div>
</body>
</html>
@screen-sm-min: 768px;
@screen-md-min: 992px;
@screen-lg-min: 1200px;
.container {
margin: auto;
}
/* Small devices (tablets, 768px and up) */
@media (min-width: @screen-sm-min) {
.container {
max-width: 750px;
}
}
/* Medium devices (desktops, 992px and up) */
@media (min-width: @screen-md-min) {
.container {
max-width: 970px;
}
}
/* Large devices (large desktops, 1200px and up) */
@media (min-width: @screen-lg-min) {
.container {
max-width: 1170px;
}
}
/* Add column colors for demonstration */
.pure-g > div,
.pure-g-r > div {
background-color: #1f8dd6;
color: white;
padding-top: 1em;
text-align: center;
}
.pure-g :nth-child(odd),
.pure-g-r :nth-child(odd){
background-color: #777;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment