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. 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


Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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


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.


                <button class="show-box">show box</button>


                body {
  width: 100%;
  height: 100vh;
  line-height: 1.6;
  background-color: #222;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

.show-box {
  background-color: #fff;
  text-transform: uppercase;
  font-size: 1.3rem;
  line-height: 1;
  text-align: center;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: none;
  outline: none;
  border-radius: 5px;
  box-shadow: 2px 2px 3px rgba(0,0,0,.5) inset;
  transition: background-color 0.2s,
    color 0.2s;

.show-box:focus {
  background-color: rgba(0,0,0,.2);
  color: #fff;
  box-shadow: 2px 2px 3px rgba(0,0,0,.5) outset; 

.box {
  width: 100px;
  height: 100px;
  background-color: rebeccapurple;
  border-radius: 5px;
  opacity: 0;
  visibility: hidden;
  position: relative;
  top: 0px;
  transform: scale(0) translatey(-1000px);
  transition: 1s;

.box.slide-in {
transform: scale(1) translatey(0);
  opacity: 1;
  visibility: visible;


                (function() {
  const button = document.querySelector(".show-box");

  // create a function that calls requestAnimationFrame
  const doTransition = () => {
    // add the class that triggers the transition to the box element

  button.addEventListener("click", () => {
    // create the box
    const box = document.createElement("div");
    // add a class of box
    // insert the box element into the DOM
    // call requestAnimationFrame passing the doTransition function as argument
    // remove the button at the end of the animation