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 includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

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

              
                <h1>Flexbox grid with gutter</h1>
<div class="grid-4"> <!-- 4 columns with padding -->
  <div>
    1- lorem ipsum<br>Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Gal. 
  </div>
  <div>
    2- lorem ipsum Hopla choucroute !
  </div>
  <div>
    3- lorem ipsum<br>condimentum Verdammi ch'ai ac réchime météor barapli s'guelt quam, non Christkindelsmärik blottkopf, Carola tellus rucksack vielmols, Gal !
  </div>
  <div>
    4- lorem ipsum  lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum
  </div>
  <div>
    5- lorem ipsum<br>Yoo ch'ai lu dans les DNA que le Racing a encore perdu contre Oberschaeffolsheim. Verdammi 
  </div>
  <div>
    6- lorem ipsum<br>Lorem Elsass ipsum lacus leverwurscht Wurschtsalad mamsell Gal.
  </div>
  <div style="margin-left: auto;">
    7- simple "offset" with <br><code>margin-left: auto</code>
  </div>
</div>
<h2><a href="https://codepen.io/raphaelgoetter/pen/BybOag?editors=010">Going further with LESS</a></h2>
              
            
!

CSS

              
                /* 
width = 25%
gutter = 30px
*/


.grid-4 {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	margin-left: -30px;
	
	/* Inline-block fallback */
  letter-spacing: -0.31em;
  text-rendering: optimizespeed;
}
.grid-4 > * {
	flex: 0 0 auto;
	width: calc(25% - 30px); 
	margin-left: 30px;
	display: block;  /* IE fix */
	
	/* Inline-block fallback */
  display: inline-block;
  vertical-align: top;
  letter-spacing: normal;
	text-rendering: auto;
}

/* deco */
* {
  box-sizing: border-box;
}
body {
  margin: 20px;  
  font-family: helvetica, arial, sans-serif;
	font-size: 1em;
}

[class*="grid-"] > div {  
  margin-bottom: 20px; 
	padding: 1em;
	border: .25em dotted goldenrod;
  color: #fff; 
  background-color: olivedrab;
}

h1 {
	margin: 1em 0 1em;
	color: #345;
	text-align: center;
  font-family: georgia, "trebuchet ms", arial, serif;
}
h2 {
	margin: 1em 0 1em;
	color: #345;
	text-align: center;
  font-family: georgia, "trebuchet ms", arial, serif;
}
a {color: #345}
              
            
!

JS

              
                
              
            
!
999px

Console