Pen Settings



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


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


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.


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.


  <div class="wrapper">
    <article class="flow">
      <div class="controls">
          <label for="switcher">modal overscroll-behavior:</label>
          <select id="switcher">
            <option value="contain">contain</option>
            <option value="auto">auto</option>
            <option value="none">none</option>
        <!-- Trigger/Open The Modal -->
<button id="myBtn">Open Modal</button>

<!-- The Modal -->
<div id="myModal" class="modal">

  <!-- Modal content -->
  <div class="modal-content">
    <span class="close">&times;</span>
    <h2>Scroll in this modal</h2>
    <p>Cupcake tart cheesecake cake oat cake apple pie. Carrot cake fruitcake sugar plum dragée cotton candy fruitcake cookie. Shortbread tiramisu sugar plum marzipan shortbread soufflé. Chupa chups jelly-o gummies lollipop gummi bears caramels jelly beans jujubes dessert. Chocolate bar candy canes shortbread toffee bear claw shortbread cheesecake brownie. Jujubes chocolate bar chocolate bar pie icing. Wafer brownie sweet cotton candy bonbon candy canes liquorice cake toffee. Muffin croissant fruitcake shortbread wafer gummi bears chocolate cake gingerbread donut.</p>



                :root {
  --var-overscroll-behavior: 'contain';

.modal-content {
  overscroll-behavior: var(--var-overscroll-behavior);

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: #272eb590;

.modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 30px;
  border: 3px solid var(--color-primary-light);
  border-radius: 20px;
  width: 70%;
  height: 50%;
  overflow: auto;

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;

.close:focus {
  color: var(--color-primary-light);
  text-decoration: none;
  cursor: pointer;

main {
  height: 150vh;



                let root = document.documentElement;
let overscroll= document.getElementById("switcher");
overscroll.addEventListener("change", function (evt) {'--var-overscroll-behavior',;
});'--var-overscroll-behavior', 'contain');

var modal = document.getElementById("myModal");
var btn = document.getElementById("myBtn");
var span = document.getElementsByClassName("close")[0];

btn.onclick = function() { = "block";

span.onclick = function() { = "none";

window.onclick = function(event) {
  if ( == modal) { = "none";