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>
    <img src="https://hajimete.org/wp-content/uploads/2019/06/title.png" alt="logo" />
  <span>三</span>
  </header>
  <main>
    <div id="top_contents">
      <div class="top_inner">
        <h1>我々は宇宙人だ。</h1>
        <p>
          世界征服には、どうしたってUFOは欠かせない代物である。<br />
          我々のUFOを紹介しよう!
        </p>
      </div>
    </div>
  </main>
<div id="menu" class="suru">
  <div class="menu_inner">
    <h2>MENU</h2>
    <ul>
      <li>UFOについて</li>
      <li>UFOとは?</li>
      <li>謎の飛行物体「UFO」</li>
      <li>UFOと未確認飛行物体</li>
      <li>ユーフォメーション(UFO)</li>
    </ul>
  </div>
</div>
              
            
!

CSS

              
                body {
      margin: 0;
      padding: 0;
    }
    a {
      text-decoration: none;
      color: rgb(13, 199, 143);
      display: block;
    }
    header {
      position: fixed;
      z-index: 10;
      top:0;
      left:0;
      width: 100%;
      height: 60px;
      background: #fff;
      box-shadow: 0 2px 30px -20px rgba(0,0,0,.4);
    }
    header img {
      position: absolute;
      top: 50%;
      left: 20px;
      height: 45%;
      display:block;
      transform: translateY(-50%);
      -webkit-transform: translateY(-50%);
    }
header span {
  position: absolute;
  top: 50%;
  right: 20px;
  height: 45%;
  display:block;
  font-size: 24px;
  line-height: 1;
  font-weight: 800;
  transform: translateY(-50%);
  -webkit-transform: translateY(-50%);
  cursor: pointer;
}
    #top_contents {
      position: relative;
      width: 100%;
      height: 800px;
      text-align: center;
      display: block;
    }
    .top_inner {
      position: absolute;
      top: 50%;
      left: 50%;
      transform:translate(-50%, -50%);
      -webkit-transform:translate(-50%, -50%);
    }
    .top_inner a {
      display: block;
      padding: 8px 20px;
      margin-top: 30px;
      border: 1px solid rgb(13, 199, 143);
      border-radius: 12px;
      min-width: 240px;
    }
#menu {
  position: fixed;
  z-index: 9;
  top:0;
  left:0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,.95);
  display: block;
  color: #fff;
  transition: .6s ease-in-out;
  -webkit-transition: .6s ease-in-out;
}
.menu_inner {
  position: absolute;
  top:50%;
  left: 50%;
  transform:translate(-50%, -50%);
  -webkit-transform:translate(-50%, -50%);
  display:block;
  width: 280px;
  padding-top: 60px;
  text-align: center;
}
.menu_inner h2 {
  margin-bottom: 20px;
}
.menu_inner ul {
  padding:0;
}
.menu_inner li {
  width: 100%;
  display: block;
  margin-top:20px;
  padding: 12px 0;
  border-bottom: 1px solid #fff;
}
.suru {
  transform: translateY(-100%);
  -webkit-transform: translateY(-100%);
}
              
            
!

JS

              
                $(function() {
  $("header span").on("click", function() {
    if($(this).text() == "三") {
      $(this).text("×");
      $("#menu").removeClass("suru");
    } else {
      $(this).text("三");
      $("#menu").addClass("suru");
    }
  });
});
              
            
!
999px

Console