Pen Settings



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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.



  <h2>Vertical Rhythm With  CSS Grid</h2>

  <p>Imagine that you're tasked with building or managing a website containing a real-estate agency's portfolio. On the website, you display pictures, house addresses, locations, number of rooms and other attributes. On the admin screen, you manage the portfolio, adding, removing and editing existing real estate.</p>

  <p>The columns WordPress shows by default (title, author, publication date, number of comments) are hardly relevant for your real-estate website, and you'd be more interested in seeing the existing pictures and information about the real-estate listings as a whole.</p>


  <p>Let's look at a standard admin overview screen for custom post types:</p>

  <figure class="break-out"><a href=""><img src="" width="800" height="444" alt="Admin overview screen for custom post types"></a><figcaption>(<a href="">View large version</a>)</figcaption></figure>

  <p>This would be pretty useful if this were our website's blog posts or news items, right? But for our real-estate portfolio, this gives us no information at all. The same goes for web shops, car dealerships, creative portfolios and so forth. Luckily, there's a solution. We'll work towards a far more pleasing overview of our real-estate portfolio, which will look like this.</p>


                :root {
  --offset: 1.3rem + 1vmin + .5vw;
  --type-offset: 1.1rem + 0.5vw;

html {
    font-size: 100%;

body {
  line-height: calc(var(--offset, calc(1.3rem + 1.6vmin)));
  font-family: 'Elena', /* Web font */
                -apple-system, BlinkMacSystemFont,  /* macOS */
                AvenirNext, Avenir, /* iOS */
                'Roboto Slab', 'Droid Serif', /* Android */
                'Segoe UI',  /* Microsoft  */
                Oxygen-Sans, /* KDE */
                Ubuntu, /* Ubuntu */ 
                Cantarell, /* GNOME */
                Georgia, 'Times New Roman', serif; /* Fallback */
    font-size: calc(var(--type-offset, calc(1rem + .75vmin)));

img {
	max-width: 100%;
  height: auto;

article {
	display: grid;
	grid-template-columns: [full-width-start] 1fr [content-start] repeat(12, minmax(0, 4.5ch)) [content-end] 1fr [full-width-end];
	grid-row-gap: calc(var(--offset));

article > * {
	margin: 0;
	grid-column: content;

article > .break-out {
	grid-column: full-width;
	justify-self: center;
	margin: calc(0.5 * var(--offset)) 0;

h2 {
	margin: calc(2 * var(--offset)) 0 0 0;
  font-size: calc(1.5rem + 2.5vmin); 
  line-height: calc(1.5 * var(--offset));

h3 {
	margin: calc(0.5 * var(--offset)) 0 0 0;
  font-size: calc(1rem + 1.5vmin);