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

              
                <div class="scroll-y">
  <div class="scroll-y-content">
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Duis at consectetur lorem donec massa. Pellentesque massa placerat duis ultricies. Nibh praesent tristique magna sit amet purus gravida. Lectus arcu bibendum at varius vel pharetra vel turpis nunc. In egestas erat imperdiet sed euismod. Sed augue lacus viverra vitae congue eu. Maecenas accumsan lacus vel facilisis volutpat. Sed viverra ipsum nunc aliquet bibendum enim. Ante metus dictum at tempor commodo ullamcorper a. Platea dictumst quisque sagittis purus sit. Nisl tincidunt eget nullam non nisi est sit. Est ante in nibh mauris cursus mattis. Malesuada fames ac turpis egestas integer eget. Tellus cras adipiscing enim eu turpis egestas. Purus viverra accumsan in nisl nisi scelerisque eu.</p>
    <p>Ultrices tincidunt arcu non sodales neque. Dictum non consectetur a erat nam at lectus. Ornare massa eget egestas purus viverra accumsan in. Egestas purus viverra accumsan in. Ut eu sem integer vitae justo eget magna fermentum. Tincidunt augue interdum velit euismod. Sit amet commodo nulla facilisi nullam vehicula ipsum. Nisi lacus sed viverra tellus in hac habitasse platea. Nunc mattis enim ut tellus elementum. Condimentum lacinia quis vel eros donec.</p>
    <p>Sagittis aliquam malesuada bibendum arcu. Non blandit massa enim nec dui nunc. Mauris nunc congue nisi vitae suscipit. Adipiscing elit duis tristique sollicitudin nibh sit amet. Nunc consequat interdum varius sit amet mattis vulputate enim. Diam quis enim lobortis scelerisque. Risus at ultrices mi tempus imperdiet nulla malesuada pellentesque elit. Egestas dui id ornare arcu odio ut sem nulla pharetra. Orci phasellus egestas tellus rutrum tellus pellentesque. Lectus nulla at volutpat diam ut venenatis tellus. Vitae tempus quam pellentesque nec nam aliquam sem et tortor.</p>
  </div>
</div> 
              
            
!

CSS

              
                * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 22px;
  padding: 10px;
  color: #555;
}

.scroll-y {
  width: 300px;
  height: 300px;
  border: 1px solid #ddd;
  overflow-y: hidden; /* not to mess up scroll on touch devices */
}

.scroll-y:hover {
  overflow-y: scroll;
}

.scroll-y-content {
  padding: 20px 0 20px 20px;
  width: 280px; /* 20px less than parent width */
}

/* smartphones, touchscreens */
@media (hover: none) and (pointer: coarse) {
  .scroll-y:hover {
    overflow-y: scroll;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console