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

              
                
<section class="style-1">
  <h2 id="style-name">School Essay</h2>
  <ol id="quotes">
    <li><p>The early bird catches <del>the worm</del><ins>less sleep</ins>.</p></li>
    <li><p>The best things in life are <del>free</del><ins>extremely expensive</ins>.</p></li>
    <li><p>Shoot for the moon. Even if you miss, you'll <del>land among the stars</del><ins>suffocate in outer space and die</ins>.</p></li>
    <li><p><del>Everything</del><ins>Nothing</ins> is going to be fine.</p></li>
    <li><p>Big girls don't <del>cry</del><ins>submit to people telling them what to do</ins>.</p></li>
  </ol>
</section>


<button data-style="style-1" data-title="School Essay">Style 1</button>
<button data-style="style-2"data-title="Update on Hover">Style 2</button>
              
            
!

CSS

              
                button{
  background:#333333;
  border:0;
  border-radius:3px;
  color:white;
  font-family:'Varela Round', sans-serif;
  margin-top:30px;
  min-width:150px;
  outline:none;
  padding:10px 15px;
  transition:all .3s;
  &:hover{
    background:black;
    cursor:pointer;
  }
  &[disabled]{
    background:#898989;
    cursor:not-allowed;
    opacity:.8;
  }
}

body{
  color:#333;
  font-family:"Nunito",sans-serif;
}
#quotes{
  box-sizing:border-box;
  list-style-position:inside;
  padding:0;
  li{
    padding:10px 15px;
  }
  p{
    display:inline-block;
    margin:0;
  }
}

.style-1{
  #quotes{
    border-bottom:1px solid #aaa;
    margin:0;
  }
  li{
    border-top:1px solid #aaa;
  }
  del{
    position:relative;
    text-decoration:none;
    &:before{
      content:"";
      background:#a30000;
      height:1px;
      position:absolute;
      left:-3px;
      top:50%;
      width:90%;
      transform:rotate(1deg);
    }
    &:after{
      content:"";
      background:#a30000;
      height:1.25px;
      position:absolute;
      right:3px;
      bottom:32%;
      width:95%;
      transform:rotate(-.25deg);
    }
  }

  ins{
    color:#a30000;
    font-family: 'Caveat', cursive;
    font-size:1.25em;
    text-decoration:none;
    position:absolute;
    margin-top:-20px;
    margin-left:-50px;
    transform:rotate(-4.5deg);
  }
}

@keyframes borderBlink {
    from, to {
        border-color: transparent;
    }    
    50% {    
        border-color: #333;
    }
}

.style-2{
  li{
    margin-bottom:15px;
  }
  del{
    display:inline-block;
    overflow:hidden;
    padding:0 2px;
    white-space:nowrap;
    transition:all 1s;
    transition-delay:1s;
    background:rgba(255,189,22,.8);
    border-right:1px solid transparent;
    margin:-6px 0;
    max-width:150px;
    padding-right:1px;
    text-decoration:none;
  }
  ins{
    transition:all 1s;
    transition-delay:0;
    background:#00d185;
    display:inline-block;
    margin:-6px 0;
    overflow:hidden;
    padding:0;
    position:relative;
    text-decoration:none;
    white-space:nowrap;
    max-width:0;
  }
  li:hover{
    cursor:pointer;
    del{
      border:0;
      max-width:0;
      padding:0;
      transition-delay:0s;
      + ins{
        max-width:300px;
        padding:0 2px;
        transition-delay:1s;
      }
    } 
  }
}
              
            
!

JS

              
                $(function(){
  $("button").click(function(){
    var style = $(this).data("style");
    $("section").removeAttr("class");
    $("section").addClass(style);
    $("#style-name").html($(this).data("title"));
  })
})
              
            
!
999px

Console