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

              
                <header>
  <div id="nav-drawer">
    <input id="nav-input" type="checkbox" class="nav-unshown">
    <label id="nav-open" for="nav-input"><span></span></label>
    <label class="nav-unshown" id="nav-close" for="nav-input"></label>
    <div id="nav-content">
      <label class="nav-unshown" id="nav-close" for="nav-input">
        <img src="https://allegretto-works.com/blog/wp-content/uploads/2018/11/icon_close.svg" alt="閉じる">
      </label>
      <ul>
        <li><a href="">メニュー1</a></li>
        <li><a href="">メニュー2</a></li>
        <li><a href="">メニュー3</a></li>
        <li><a href="">メニュー4</a></li>
      </ul>
    </div>
  </div>
</header>
              
            
!

CSS

              
                header
  position: relative
  #nav-drawer
    position: absolute
    top: 1.8em
    right: .5em
  .nav-unshown
    display: none
  #nav-open
    display: inline-block
    width: 30px
    height: 22px
    vertical-align: middle
  #nav-open span, #nav-open span:before, #nav-open span:after /*ハンバーガーアイコン*/
    position: absolute
    height: 3px
    width: 25px
    border-radius: 3px
    background: black
    display: block
    content: ''
    cursor: pointer
  #nav-open span:before
    bottom: -8px
  #nav-open span:after
    bottom: -16px
  #nav-close
    display: none
    position: fixed
    z-index: 99
    height: 100%
    width: 2em
    height: 2em
    top: 1em
    right: 1em
    display: inline-block
    padding: 10px 3px
    z-index: 9
    cursor: pointer
    animation: animScale 2s ease 0s 1 normal
  #nav-content
    overflow: auto
    position: fixed
    top: 0
    right: 0
    z-index: 9
    width: 100%
    height: 100%
    color: white
    background: black
    transition: .3s ease-in-out
    transform: translateX(105%) //左に隠しておく
    ul
      padding: 3em 2em 2em
    li
      font-size: 1.5em
      text-align: center
      padding: 1em 0
  #nav-input:checked ~ #nav-close
    display: block
  #nav-input:checked ~ #nav-content
    -webkit-transform: translateX(0%)
    transform: translateX(0%) //中身を表示させる
    box-shadow: 6px 0 25px rgba(0,0,0,.15)
              
            
!

JS

              
                
              
            
!
999px

Console