Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!DOCTYPE HTML>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<title>CSS Grid Layout - a flexible 960 grid, using LESS</title>
		
		

	</head>
	<body>
	<h1 class="title">Flexible 960 Grid</h1>
	
	<div class="wrapper">
		<div class="box grid1">01</div>
		<div class="box grid2">02</div>
		<div class="box grid3">03</div>
		<div class="box grid4">04</div>
		<div class="box grid5">05</div>
		<div class="box grid6">06</div>
		<div class="box grid7">07</div>
		<div class="box grid8">08</div>
		<div class="box grid9">09</div>
		<div class="box grid10">10</div>
		<div class="box grid11">11</div>
		<div class="box grid12">12</div>
		<div class="box grid13">13</div>
		<div class="box grid14">14</div>
		<div class="box grid15">15</div>
		<div class="box grid16">16</div>

		<div class="box grid17">17</div>
		<div class="box grid18">18</div>
		<div class="box grid19">19</div>
		<div class="box grid20">20</div>
		<div class="box grid21">21</div>
		<div class="box grid22">22</div>
		<div class="box grid23">23</div>
		<div class="box grid24">24</div>	

		<div class="box grid25">25</div>
		<div class="box grid26">26</div>
		<div class="box grid27">27</div>
		<div class="box grid28">28</div>
		<div class="box grid29">29</div>


		<div class="box grid30">30</div>
		<div class="box grid31">31</div>
		<div class="box grid32">32</div>
		<div class="box grid33">33</div>

		<div class="box grid34">34</div>
		<div class="box grid35">35</div>
		<div class="box grid36">36</div>

		<div class="box grid37">37</div>
		<div class="box grid38">38</div>
		<div class="box grid39">39</div>

		<div class="box grid40">40</div>
		<div class="box grid41">41</div>
		<div class="box grid42">42</div>

		<div class="box grid43">43</div>
		<div class="box grid44">44</div>
		<div class="box grid45">44</div>
	</div>
	</body>
</html>
              
            
!

CSS

              
                body {
	margin: 0;
	padding: 20px;
	background-color: #999;
	color: #fff;
	background-image: url("http://media.24ways.org/2012/andrew/otis_redding.png");
	font: 87.5%/1.4 HelveticaNeue, "Helvetica Neue", Helvetica, Arial, sans-serif;
}


h1, h2, h3, h4, h5, h6 {
    font-family: "Georgia","Times New Roman",serif;
    font-weight: normal;
    padding: 0;
    margin: 0;
}

h1 {
    font-size: 328.571%;
    margin-bottom: 0.2em;
}

h1.title {
	text-align: center;
	text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

h2 {
    font-size: 250%;
    margin-bottom: 0.2em;
}

h3 {
    font-size: 150%;
    margin-bottom: 0.2em;
}

p {
	margin:0;
	padding: 0 0 1em 0;
}

.box {
    background-color: #ddd;
    padding: 10px 10px 1px;
    color: #444;
}

.position(@column,@row,@colspan,@rowspan) {
  -ms-grid-column: @column*2;
  -ms-grid-row: @row*2-1;
  -ms-grid-column-span: @colspan*2-1;
  -ms-grid-row-span: @rowspan*2-1;
}

/* the values below are wrapped with ~" " in order to not break the LESS compiler */
.wrapper {	 
  width: 90%;
  margin: 0 auto 0 auto;
  display: ~"-ms-grid";
  -ms-grid-columns:~" 1fr (4.25fr 1fr)[16]";
  -ms-grid-rows:~" (auto 20px)[9]";
}


/* this is an example of positioning items on the grid
first row, single column items */
.grid1 { .position(1,1,1,1); } 
.grid2 { .position(2,1,1,1); } 
.grid3 { .position(3,1,1,1); } 
.grid4 { .position(4,1,1,1); } 
.grid5 { .position(5,1,1,1); }
.grid6 { .position(6,1,1,1); }
.grid7 { .position(7,1,1,1); }
.grid8 { .position(8,1,1,1); }
.grid9 { .position(9,1,1,1); }
.grid10 { .position(10,1,1,1); }
.grid11 { .position(11,1,1,1); }
.grid12 { .position(12,1,1,1); }
.grid13 { .position(13,1,1,1); }
.grid14 { .position(14,1,1,1); }
.grid15 { .position(15,1,1,1); }
.grid16 { .position(16,1,1,1); }

/* second row items span 2 columns and one gutter */
.grid17 { .position(1,2,2,1); }
.grid18 { .position(3,2,2,1); }
.grid19 { .position(5,2,2,1); }
.grid20 { .position(7,2,2,1); }
.grid21 { .position(9,2,2,1); }
.grid22 { .position(11,2,2,1); }
.grid23 { .position(13,2,2,1); }
.grid24 { .position(15,2,2,1); }

/* third row we have 4 items spanning 3 cols and 1 spanning 4 */
.grid25 { .position(1,3,3,1); }
.grid26 { .position(4,3,3,1); }
.grid27 { .position(7,3,3,1); }
.grid28 { .position(10,3,3,1); }
.grid29 { .position(13,3,4,1); }

/* fourth row 4 items spanning 4 columns each */
.grid30 { .position(1,4,4,1); }
.grid31 { .position(5,4,4,1); }
.grid32 { .position(9,4,4,1); }
.grid33 { .position(13,4,4,1); }

/* now let's get a little crazy ... */
.grid34 { .position(1,5,1,1); }
.grid35 { .position(1,6,1,1); }
.grid36 { .position(1,7,1,1); }
.grid37 { .position(1,8,1,1); }
.grid38 { .position(11,5,6,4); }
.grid39 { .position(6,5,1,2); }
.grid40 { .position(6,7,2,2); }
.grid41 { .position(2,5,4,4); }
.grid42 { .position(8,8,3,1); }
.grid43 { .position(8,5,3,3); }
.grid44 { .position(7,5,1,1); }
.grid45 { .position(7,6,1,1); }
              
            
!

JS

              
                
              
            
!
999px

Console