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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <main>
  <p>The <a target="_blank" href="https://www.w3.org/TR/css3-values/#em">em</a> unit is interesting.</p>
  <p>It takes the parent's font size and multiplies it by the value you give it.</p>
  <section class="example small-text">
    <p class="em">This text is 2em</p>
    <p class="match">This text is the same as the parent's font size. Which is 10px.</p>
  </section>
  <p>Above, the parent's font size is 10px while the first paragraph's font size is 2em.</p>
  <p>This means the first paragraph's pixel font size is 20px.</p>
  
  <section class="example large-text">
    <p class="em">This text is 2em</p>
    <p class="match">This text is the same as the parent's font size. Which is 20px.</p>
  </section>  
  
  <p>But <code>em</code> can be used outside of sizing text.</p>
  <section class="example large-text">
    <div class="em-width"></div>
  </section>
  <p>The rectangle above has its width set to 3em while its parent has a font size of 20px.</p>
  <p>Making the rectangle's pixel width 60px.</p>
  
  <p>Very cool. ☃️</p>
  <footer class="important">
    <a target="_blank" href="https://xotv.me/channels/22-important/vod_videos/824-important-slash-slash-dribbble-dot-com">!important</a>
  </footer>
</main>
            
          
!
            
              .em {
  font-size: 2em;
}

.em-width {
  width: 3em;
  height: 10px;
}

.match {
  font-size: 1em;
}

.large-text {
  font-size: 20px;
}

.small-text {
  font-size: 10px;
}

.example {
  margin: 0.5rem auto;
  padding: 0.5rem;
  border: 2px solid #ffe8ec;
  border-radius: 5px;
  text-align: center;
}

.example p {
  margin-top: 0;
  margin-bottom: 0;
}

.example p:last-of-type {
  margin-top: 0.5rem;
}

code {
  padding: 0 5px 2px;
  background-color: #fca67d;
  border-radius: 2px;
  font-family: inherit;
}

div {
  background-color: #ffe8ec;
}

p {
  font-size: 1.1rem;
  font-weight: 500;
  color: #f7f7f7;
}

a {
  font-weight: 900;
  color: #ffe3b0;
  text-decoration-style: dashed;
}

a:hover {
  text-decoration-style: solid;
}

main {
  max-width: 27rem;
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 5px;
  color: white;
  background-color: #ea8071;
}

body {
  padding: 0;
  margin: 0;
  background-color: #e7e7e7;
  font-family: Verdana, Geneva, sans-serif;
}

.important {
  display: block;
  color: #ffc5bc;
  text-align: center;
  transition: all 0.2s ease-in-out;
}

.important:hover {
  animation-name: wiggle;
  animation-duration: 0.5s;
  animation-timing-function: ease-in-out;  
  
  padding: 10px;
  box-shadow: 0 0 4px 1px #d05b4a;
  background-color: #ee897a;
  color: #000;
  text-decoration: none;
  font-size: 1.2rem;
}

@keyframes wiggle {
  0% {
    transform: rotate(0turn);
  }

  25% {
    transform: rotate(0.01turn);
  }

  50% {
    transform: rotate(-0.01turn);
  }

  100% {
    transform: rotate(0turn);
  }
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console