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

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

              
                .wrapper
  .modal
    .modal__content
      p モーダルウィンドウコンテンツ
      p あのイーハトーヴォのすきとおった風、夏でも底に冷たさをもつ青いそら、うつくしい森で飾られたモリーオ市、郊外のぎらぎらひかる草の波。 またそのなかでいっしょになったたくさんのひとたち、ファゼーロとロザーロ、羊飼のミーロや、顔の赤いこどもたち、地主のテーモ、山猫博士のボーガント・デストゥパーゴなど、いまこの暗い巨きな石の建物のなかで考えていると、みんなむかし風のなつかしい青い幻燈のように思われます。では、わたくしはいつかの小さなみだしをつけながら、しずかにあの年のイーハトーヴォの五月から十月までを書きつけましょう。
      button.modal__close モーダルクローズ
    .modal__bg
  button.modal__open モーダルオープン
              
            
!

CSS

              
                *{
  box-sizing: border-box;  
}
.wrapper{
  height: 1000px;
}
.modal{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: .3s opacity ease , 0s visibility .3s linear;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  &.is-open{
  transition: .3s opacity ease , 0s visibility 0s linear;
    opacity: 1;
    visibility: visible;   
  }
  &__content{
    position: relative;
    z-index: 2;
    padding: 20px;
    background-color: #fff;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    flex:0 1 1000px;
    width: 100%;
    max-width: 1000px;
    max-height: 100%;
  }
  &__bg{
    position: absolute;
    z-index: 1;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
  }
  &__open,&__close{
    display: block;
    width: 300px;
    height: 50px;
    margin: 20px auto;    
  }
}

              
            
!

JS

              
                (function(){
    const modal = document.querySelector('.modal');
    const openbtn = document.querySelector('.modal__open');
    const closebtn = document.querySelector('.modal__close');
    openbtn.addEventListener('click',()=>{
      modal.classList.add('is-open');
    });
    closebtn.addEventListener('click',()=>{
      modal.classList.remove('is-open');
    });
})();
              
            
!
999px

Console