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

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

              
                <main>
  <p>The <a target="_blank" href="https://www.w3.org/TR/css3-values/#vh">vh</a> unit is very similar to the <a target="_blank" href="https://codepen.io/fmressel/pen/NBMVKM">vw</a> unit. With really the only difference being, it's relative to the viewport height instead of its width.</p>
  <p><code>vh</code> stands for viewport height.</p>
  <p>1vh is equal to, yes, you guessed it, 1/100th of the viewport height. If the viewport height is 100px, then 1vh will equal 1px.</p>
  
  <p>The div below has a height property set to 10vh. Resize the page vertically to see its height change.</p>
  <section class="example">
    <div class="vh-height"></div>
  </section>
  
  <p>The <code>vh</code> unit can be used on properties other than height. Sounds familiar.</p>
  <section class="example">
    <p class="vh-text">This text has a font size of 4vh.</p>
  </section>
  
  <p>You can even use <code>vh</code> to set an element's width. Wait. Really?</p>
  <section class="example">
    <div class="vh-width"></div>
  </section>
  
  <p>Yes. Really.</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>
              
            
!

CSS

              
                .vh-height {
  width: 20px;
  height: 10vh;
}

.vh-text {
  font-size: 4vh;
}

.vh-width {
  width: 10vh;
  height: 20px;
}

.vh-height, .vh-width {
  margin: 0 auto;
}

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

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;
  margin-top: 1em;
  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);
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console