Pen Settings



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


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.


<h1>SECTION 01</h1>
<section id="sec2">
<h2>SECTION 02</h2>
<section id="sec3">
<h2>SECTION 03</h2>
<section id="sec4">
<h2>SECTION 04</h2>
  <footer><small>PAGE END.</small></footer>
    <li><a href="#sec2">SECTION 02</a></li>
    <li><a href="#sec3">SECTION 03</a></li>
    <li><a href="#sec4">SECTION 04</a></li>
    <li class="fade"><a href="#">TOP</a></li>


                * { margin: 0; padding: 0; }
section {
  position: relative;
  width: 100vw; height: 100vh;
  footer {
    position: absolute; left: 0; bottom:0;
    width: 100%;
    background:rgba(0,0,0,0.5); color: #FFF;
    small { padding: 0.5em; }
nav {
  bottom:0; left:50%;
  transform: translateX(-50%);
  ul {
    a {
      padding: 0.75em 2em;
      text-align: center; text-decoration: none;
      display: block;



  /* スムーズスクロール */
  $('a[href^="#"]').click(function() {
    var speed = 400; // スクロールの速度(ミリ秒)
    var href= $(this).attr("href");
    var target = $(href == "#" || href == "" ? 'html' : href);
    var position = target.offset().top;
      scrollTop:position}, speed, 'swing');
    return false;
  /* ページトップ位置での表示切替 */
    var toplimit = 100; // 切替えるスクロール位置(px)
    if ($(window).scrollTop() < toplimit) {
    } else {
  /* / ページトップ位置での表示切替 */