Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!-- Sidebar container -->
<aside class="site-sidebar">
  
  <h3>Sidebar</h3>
  
  <p>Lorem ipsum dolor sit amet, ferri vidisse nam eu, ad nec copiosae mnesarchum vituperatoribus. Te brute dicunt sea, ut vis omnium menandri, ut sumo aliquam has. Eum aperiam interpretaris at, sea et recusabo expetenda, omnis tibique mea no. Pri suas partem ea, ius sonet numquam offendit cu, ad simul admodum pri. Eum cu unum choro albucius.</p>

<p>Eu integre accusata prodesset est, sed te impetus gubergren conceptam, ex sed wisi nostrum ocurreret. Esse velit omittantur ius te, alii dissentias ei vis. At sed unum veritus fabellas. Te volutpat appellantur duo. Ad natum fuisset intellegebat eam, causae invidunt usu id, et vis impetus appetere.</p>
</aside>

<!-- Main content container -->
<article class="site-content">

  <figure class="wp-block-image alignfull">
    <img src="https://cldup.com/m7_aXlDCXw.jpg" alt="">
  </figure>

  <p>Full-wide image above 👆</p>
  
  <h2>Wide images, floats, and sidebars in Gutenberg</h2>

  <p>The big change since <a href="https://codepen.io/joen/pen/oEYVXB">last time</a> is that now any floated image has a wrapping <code>div</code> container.</p>

  <div class="wp-block-image">
    <figure class="alignleft">
      <img src="https://cldup.com/yPKF2vjugC.jpg" alt="" width="200px">
      <figcaption>Short image caption.</figcaption>
    </figure>
  </div>

  <p>Est quis reque cetero ad. Sea id autem nominavi deseruisse. Veniam qualisque definitionem pri id, ea autem feugiat delenit ius, mei at lorem affert accumsan. Dicat eruditi cu est, te pro dicant pericula conclusionemque, ei vim detracto euripidis intellegam.
    Eius postea volumus mei ad.</p>

  <p>Prima ridens denique his te, ferri illum volumus an his. Eu vel dicat homero qualisque, vitae regione deserunt vis ei. Graeci incorrupte liberavisse no mea, saepe voluptaria usu ex, vis dicant euismod id. At dolor reprimique eos, quo altera detraxit
    moderatius id. Quo iudico utinam eu, ad alia munere mel.</p>

  <div class="wp-block-image">
    <figure class="alignright">
      <img src="https://cldup.com/lUUQPv6w9c.jpg" alt="" width="200px">
      <figcaption>Really quite long image caption, one that absolutely spans multiple lines. Holy guacamole who would ever write this much in a caption?.</figcaption>
    </figure>
  </div>
 
  <p>Lorem ipsum dolor sit amet, ferri vidisse nam eu, ad nec copiosae mnesarchum vituperatoribus. Te brute dicunt sea, ut vis omnium menandri, ut sumo aliquam has. Eum aperiam interpretaris at, sea et recusabo expetenda, omnis tibique mea no. Pri suas partem
    ea, ius sonet numquam offendit cu, ad simul admodum pri. Eum cu unum choro albucius.</p>

  <p>Eu integre accusata prodesset est, sed te impetus gubergren conceptam, ex sed wisi nostrum ocurreret. Esse velit omittantur ius te, alii dissentias ei vis. At sed unum veritus fabellas. Te volutpat appellantur duo. Ad natum fuisset intellegebat eam,
    causae invidunt usu id, et vis impetus appetere.</p>

  <p>Wide image below 👇</p>

  <figure class="wp-block-image alignwide">
    <img src="https://cldup.com/kAIpBuzEXf.jpg" alt="">
  </figure>

  <p>Est quis reque cetero ad. Sea id autem nominavi deseruisse. Veniam qualisque definitionem pri id, ea autem feugiat delenit ius, mei at lorem affert accumsan. Dicat eruditi cu est, te pro dicant pericula conclusionemque, ei vim detracto euripidis intellegam.
    Eius postea volumus mei ad.</p>

  <p>Prima ridens denique his te, ferri illum volumus an his. Eu vel dicat homero qualisque, vitae regione deserunt vis ei. Graeci incorrupte liberavisse no mea, saepe voluptaria usu ex, vis dicant euismod id. At dolor reprimique eos, quo altera detraxit
    moderatius id. Quo iudico utinam eu, ad alia munere mel.</p>

</article>

              
            
!

CSS

              
                /**
 * Base styles
 */

body {
  margin: 0;
  font-size: 14pt;
  line-height: 1.6;
}

* {
  box-sizing: border-box;
	-moz-box-sizing: border-box;
	-webkit-box-sizing: border-box;
}

p {
  margin: 2em 0;
}

figure {
  margin: 0;  /* Remember this one, figures are born with margins */
  text-align: center;
  
}

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


/**
 * Sidebar and main column
 */

.site-content {
  width: 80%;   /* Could be a pixel value too */
  border-right: 1px solid #eee;
}

.site-sidebar {
  width: 20%;
  float: right;
  background: #fefefe;
  height: 100%;
  padding: 20px;
}


/**
 * Fullwide CSS
 */

/* Unconstrained main colum */
.site-content > *:not( .alignwide ):not( .alignfull ) {
  max-width: 50%;   /* Could be a pixel value too: this is the one that decides the width of the text */
  margin-left: auto;
  margin-right: auto;
}

.wp-block-image.alignfull {
  display: block;
  text-align: center;
}

.wp-block-image.alignwide {
  max-width: 75%;   /* Could be a pixel value too */
  margin-left: auto;
  margin-right: auto;
}

/* We float the img inside the figure that has .alignleft applied.
   This makes the .alignleft element have the same main column width as text.
   What makes the float work is that the figure collapses into a zero height element */
 
.wp-block-image figure.alignleft {
  display: block;
  float: left;
  margin-right: 2em;
}

.wp-block-image figure.alignright {
  display: block;
  float: right;
  margin-left: 2em;
}

/* For captions, we display the figure itself as a table.
   This ensures the figcaption will retain the same width as the image,
   which is important when the caption is long. */
.wp-block-image figure.alignleft,
.wp-block-image figure.alignright {
  display: table;
}

.wp-block-image figure.alignleft figcaption,
.wp-block-image figure.alignright figcaption {
  display: table-caption;
  caption-side: bottom;
}

.wp-block-image figure.alignright figcaption,
.wp-block-image figure.alignleft figcaption {
  font-size: 75%;
  color: gray;
  margin-bottom: 1em;
}
              
            
!

JS

              
                
              
            
!
999px

Console