Pen Settings



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


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.


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.


                <div class="admin">
  <input type="range" min="10" max="35" step="1" value="20" id="slider">

  <p>Base unit is: <output id="op">20px</output><p>

<div class="Component" id="mod">
  <h2>Component Title</h2>
  <img src="" alt="Kitten">
  <p><strong>Use the range slider above</strong>.<br>The size of each element inside this module is controlled by a single unit: The <code>font-size</code>, which acts as a "root" for our em units, making everything inside the component proportionally resizable.</p>


<p class="p">Demo by Louis Lazaris. <a href="">See article</a> and <a href="">original inspiration</a>.</p>


                * {
  box-sizing: border-box;

body {
  padding: 120px 0 0 0;
  font-family: Arial, sans-serif;
  word-break: break-word;

.Component {
  font-size: 20px;
  padding: 1em;
  max-width: 30em;
  border: solid 2px #ccc;
  margin: 0 auto;
  color: #666;
  border-radius: 1em 0 1em 1em;
  position: relative;
  overflow: hidden;

  .Component:after {
    content: '';
    display: block;
    border-radius: 50% 0 50% 50%;
    width: 2em;
    height: 2em;
    position: absolute;
    top: .2em;
    right: .2em;
    background: #bbb;

  .Component h2 {
    font-size: 2em;
    margin: 0 0 .4em;

  .Component img {
    max-width: 100%;
    height: auto;
    border: solid .3em #ccc;
    float: left;
    margin: 0 1em 1em 0;

  .Component p {
    font-size: 1em;
    margin: 1em 0 0 0;
    text-align: left;

input[type="range"] {
  margin: 20px auto;
  display: block;

.admin {
  position: fixed;
  background: #eee;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;

p {
  text-align: center;

.p {
  font-size: 14px;
  padding-top: 100px;

@media screen and (max-width: 700px) {
  .Component {
    font-size: 14px; 


@media screen and (max-width: 400px) {
  .Component {
    font-size: 10px;
    width: auto;



                var slider = document.getElementById('slider'),
    mod = document.getElementById('mod'),
    op = document.getElementById('op');

slider.onchange = function () { = this.value + 'px';
  op.innerHTML = this.value + 'px';