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

              
                <article>
  <p>It is possible to use <a href="#">JavaScript</a> <span class="linkpreview">
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/milky-way-swirl-2x.jpg" alt>Web Developer Reading List: JavaScript
  </span> and several image files to achieve this, at the cost of swapping multiple image files back and forth over a potentially weak and thin wireless connection. The <a href="#">&lt;picture&gt;</a> <span class="linkpreview">
  <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/small-male-runner-2x.jpg" alt>Responsive Images For Designers: The HTML5 picture element</span>element achieves the same result, at the expense of bandwidth.</p>
<p>In an ideal world we would have an image format that integrated “dynamic crop marks”, allowing a single source image to adapt to different requirements while preserving its central focus. While we don’t have such a feature yet, we do have SVG’s <a href="#">viewBox attribute</a><span class="linkpreview">
  <span><img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/frame-2x.jpg" alt></span><span>Understanding the SVG viewBox</span></span>, which comes awfully close.</p>
  <p>While it is best known as a vector image format, SVG has supported bitmaps from its inception:</p>
</article>
              
            
!

CSS

              
                @font-face {
		font-family: 'Libertad';
		src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/libertad.woff2') format('woff2');
		font-style: normal;
		font-weight: 400;
}
@font-face {
		font-family: 'Libertad';
		src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/4273/libertad-italic.woff2') format('woff2');
		font-style: italic;
		font-weight: 400;
}
* {
    box-sizing: border-box;
}
body {
  font-family: Libertad, Avenir, sans-serif;
  line-height: 1.6;
  color: rgba(0,0,0,0.8);
  margin-bottom: 4rem;
}
article {
  width: 90%;
  max-width: 700px;
  margin: 0 auto;
  font-size: 1.3rem;
}
article p {
  position: relative;
}
.linkpreview { 
  top: 0;
  opacity: 0;
  transition: .2s;
  position: absolute;
  left: 100%;
  min-height: 100%;
  width: 10rem;
  border-left: 6px solid #2F8BCA;
  margin-left: 2rem;
  font-style: italic;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  padding: 1rem;
}
.linkpreview img {
  border-radius: 50%;
  width: 80%;
  margin-bottom: 1rem;
}
article p a {
  color: currentColor;
}

.linkpreview img {
  width: 100%;
}
a[href="#"]:hover {
  color: #2F8BCA;
}
a:hover + .linkpreview {
  opacity: 1;
}
@media all and (max-width: 1100px) {
  .linkpreview { display: none; }
}
              
            
!

JS

              
                
              
            
!
999px

Console