cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <form>
    <label><input type="checkbox" class="setting-meta" checked> Toggle region outlines</label>
</form>
<h1>CSS Regions Example</h1>
<h2>Try resizing the window to see the beautiful re-flow</h2>
<h3>Read <a target="_top" href="http://fonicmonkey.net/2013/09/09/css-regions-and-why-youll-be-using-them-before-you-know-it">the blog post</a> for a walk-through, especially if you see any empty boxes below!</h3>

<div class="region metadata" id="region1">
</div>

<div class="region metadata" id="region2">
</div>

<div class="region metadata" id="region3">
</div>

<div class="region metadata" id="region4">
</div>

<div class="content">
<em>First paragraph</em>: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec consequat laoreet eros a tincidunt. Cras augue massa, egestas ac nulla nec, mollis posuere velit. Pellentesque rhoncus urna nec metus iaculis, quis vehicula nisi pulvinar. Phasellus sed egestas felis. Vestibulum magna ante, condimentum sit amet feugiat nec, convallis sit amet quam. Quisque posuere lorem nisl, non luctus risus volutpat a. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Aenean iaculis ligula non vestibulum venenatis. Vestibulum dapibus adipiscing mauris lacinia mollis. Nulla sit amet tempor sem. Praesent nec fermentum felis.

<p>
    <em>Second paragraph</em>: Quisque vitae elit ut libero viverra condimentum. Suspendisse dignissim lorem interdum magna molestie, ut adipiscing diam bibendum. Phasellus felis odio, interdum quis purus sit amet, commodo dapibus risus. Nam viverra et arcu ut feugiat. Aliquam eu dui a urna laoreet elementum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse potenti. Aliquam erat volutpat. Curabitur nec felis vitae nibh tincidunt egestas. Nam faucibus ligula pellentesque lacus interdum porttitor. Duis auctor, orci adipiscing blandit posuere, mauris orci porttitor odio, id tincidunt risus dolor id velit.
</p>

<p>
    <em>Third paragraph</em>: Vestibulum ut lacus urna. Curabitur vitae mauris in erat posuere volutpat. Phasellus ipsum risus, bibendum consectetur tincidunt at, tristique sit amet odio. Interdum et malesuada fames ac ante ipsum primis in faucibus. Mauris a diam quis magna placerat consectetur ac eu tellus. Cras interdum non sem eu commodo. Ut feugiat ipsum a lectus feugiat condimentum.
</p>

<p>
    <em>Fourth paragraph</em>: Morbi faucibus semper pretium. Suspendisse nec posuere erat, at ullamcorper metus. Nam vitae congue nulla. Duis tempor nunc arcu. Pellentesque sed eleifend neque. Nullam pretium orci vel mauris ullamcorper ornare. Vivamus in imperdiet metus, a vestibulum turpis. Sed bibendum lacinia massa, a gravida dui cursus eget. Praesent nec ultricies velit, at egestas felis. Etiam accumsan rutrum sapien, vitae molestie enim lobortis vitae. Nunc sodales, lectus sed lobortis luctus, massa orci luctus elit, id adipiscing magna risus vitae mauris. Integer vitae ante hendrerit, placerat eros in, vehicula tortor. Vestibulum vulputate metus elit, at dictum nulla commodo ac. Vestibulum purus elit, interdum sit amet arcu vel, dignissim consectetur sem. Etiam suscipit fringilla ligula vitae congue.
</p>

<p>
    <em>Fifth paragraph</em>: Nullam imperdiet tempor orci. Vivamus a nibh tellus. In eget interdum mi. Ut pellentesque, neque ut pretium semper, urna urna venenatis lorem, ac eleifend urna nisl sit amet augue. Curabitur eros lorem, auctor vulputate tellus sit amet, consectetur commodo nunc. Donec vitae bibendum tellus, eu semper neque. Curabitur ullamcorper, tortor eu lacinia rhoncus, nulla sem mattis massa, dignissim rutrum ante felis mattis libero. Duis non tincidunt neque, id posuere diam. Donec eleifend vel odio ut malesuada. Pellentesque vel sodales neque. Integer consectetur eget orci et feugiat. Pellentesque congue metus sit amet tortor egestas, ac posuere lorem laoreet. Etiam urna nulla, auctor vulputate posuere non, rhoncus et tellus.
</p>

<p>
    <em>Sixth paragraph</em>: Morbi id sapien quis neque facilisis pretium vel nec lectus. Nam eu nulla id ligula convallis dapibus porttitor in magna. Duis sodales imperdiet lacus et ornare. Pellentesque laoreet dui ante, et aliquet dui porta a. Aenean id dictum diam. Donec mauris enim, mattis id tempor non, rhoncus tristique sem. Cras eleifend nulla vitae nunc rhoncus sagittis vitae in felis. Praesent facilisis accumsan nulla, eu tristique ipsum mattis nec. Aliquam fermentum lacus id magna vestibulum hendrerit. Vestibulum ipsum lectus, eleifend vel tortor vel, venenatis semper turpis. Curabitur in eros id sem dignissim semper nec a risus. Duis scelerisque consequat pulvinar. Aliquam eu tristique ante. Nullam eros tortor, venenatis non vehicula vel, eleifend non nisi. Aenean orci nunc, aliquam et enim vitae, fringilla condimentum ligula. Sed lobortis lectus eu ligula facilisis, a porta nibh feugiat.
</p>
</div>
<br clear="both"/>


            
          
!
            
              @import "compass/css3";

body {
    font-family: Optima, Helvetica, Arial, Sans Serif;
}

.region {
    box-sizing: border-box;
    float: left;
    width: 31%;
    padding: 10px;
    margin: 5px;
    -webkit-flow-from: myipsum;
    flow-from: myipsum;
    max-height: 200px;
    overflow: hidden;
    position: relative;
    border: 1px solid white;
}

.metadata {
    border: 1px solid green;
}

.metadata::after {
    content: ".region";
    background-color: blue;
    color: white;
    padding: 2px;
    position: absolute;
    right: 0;
    top: 0;
    opacity: .3;
    font-size: 10px;
}

#region4 {
    width: calc(93% + 20px);
    max-height: inherit;
}

.content {
    -webkit-flow-into: myipsum;
    flow-into: myipsum;
}

em {
    background-color: #f9f988;
}

h1 {
    margin: 2px 0;
}

h2 {
    margin: 5px 0;
    font-size: 16px;
}
form {
    float: right;
    margin: 1em;
}
            
          
!
            
              $('.setting-meta').bind('change', function () {
    $('.region').toggleClass('metadata', $(this)[0].checked);
});

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console