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>Grid blocks</h1>
<h2>A flexible grid using display: inline-block for floating blocks (no floats, no clearfix).</h2>

<div class="grid">
	<div class="col3_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col4_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Nulla vitae elit libero, a pharetra augue. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Nullam quis risus eget urna mollis ornare vel eu leo. Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nullam id dolor id nibh ultricies vehicula ut id elit.</div>
	<div class="col col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Nulla vitae elit libero, a pharetra augue. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</div>
	<div class="col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Nullam quis risus eget urna mollis ornare vel eu leo. Sed posuere consectetur est at lobortis.</div>
	<div class="col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg">  Cras justo odio, dapibus ac facilisis in, egestas eget quam. Nullam id dolor id nibh ultricies vehicula ut id elit.</div>
	<div class="col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col4_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean lacinia bibendum nulla sed consectetur. Donec sed odio dui. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Maecenas faucibus mollis interdum.</div>
	<div class="col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col3_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Nulla vitae elit libero, a pharetra augue. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</div>
	<div class="col3_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Nulla vitae elit libero, a pharetra augue. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</div>
	<div class="col4_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col1_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at eget metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col2_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at  et metus. Etiam porta sem male suada magna mollis euismod.</div>
	<div class="col6_8"><img src="https://f.cl.ly/items/0k1G1q2V3a3e0P0N3K31/codepen_imagestack.jpg"> Donec id elit non mi porta gravida at  et metus. Etiam porta sem male suada magna mollis euismod.</div>
</div>
              
            
!

CSS

              
                body { background: #f2e9ea; font: .875em/1.4 helvetica, arial, sans-serif; color: #555; max-width: 80em; margin: 0 auto; padding: 3em; }
h1 { font-weight: bold; font-size: 5em; line-height: 1; text-align: center; color: #7a222b; letter-spacing: -.05em; padding-top: .375em; }
h2 { font-weight: normal; font-size: 1.5em; line-height: 1.4; color: #b6858a; text-align: center; border-bottom: 10px solid #7a222b; margin-bottom: .525em; padding-bottom: 2em; }
img { display: block; width: 100%; height: auto; margin-bottom: 1em; }

/* ------------------------*/

.grid { margin-left: -1em; padding-left: 4px; }

[class^="col"] { display: inline-block; width: 100%; vertical-align: top; border-left: 1em solid transparent; margin-bottom: 3em; margin-left: -4px; -webkit-box-sizing: border-box; }

.col1_8 { width: 12.5%; }
.col2_8 { width: 25%; }
.col3_8 { width: 37.5%; }
.col4_8 { width: 50%; }
.col5_8 { width: 62.5%; }
.col6_8 { width: 75%; }
.col7_8 { width: 87.5%; }
.col8_8 { width: 100%; }
              
            
!

JS

              
                
              
            
!
999px

Console