Pen Settings

HTML

CSS

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

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

Auto Save

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>
  <h1>固定ヘッダー</h1>
</header>

<section>
  <div class="inner">

    <ul class="list" id="m_01">
      <li><a href="#a_1">1</a></li>
      <li><a href="#a_2">2</a></li>
      <li><a href="#a_3">3</a></li>
      <li><a href="#a_4">4</a></li>
      <li><a href="#a_5">5</a></li>
      <li><a href="#a_6">6</a></li>
    </ul>

    <div class="oneArea" id="a_1">
      <div class="one_title">1</div>
      <a class="button" href="#m_01">▲ メニューに戻る</a>
    </div>

    <div class="oneArea" id="a_2">
      <div class="one_title">2</div>
      <a class="button" href="#m_01">▲ メニューに戻る</a>
    </div>

    <div class="oneArea" id="a_3">
      <div class="one_title">3</div>
      <a class="button" href="#m_01">▲ メニューに戻る</a>
    </div>

    <div class="oneArea" id="a_4">
      <div class="one_title">4</div>
      <a class="button" href="#m_01">▲ メニューに戻る</a>
    </div>

    <div class="oneArea" id="a_5">
      <div class="one_title">5</div>
      <a class="button" href="#m_01">▲ メニューに戻る</a>
    </div>

    <div class="oneArea" id="a_6">
      <div class="one_title">6</div>
      <a class="button" href="#m_01">▲ メニューに戻る</a>
    </div>

    <p class="_a"><a href="https://125naroom.com/web/3651" target="_blank" class="link">View the note</a></p>

  </div>
</section>
              
            
!

CSS

              
                /*==============
調整
==============*/

#a_1, #a_2, #a_3, #a_4, #a_5, #a_6, #m_01 {
  padding-top: 100px;
  margin-top:-100px;
}

/*==============
common
==============*/

body {
  font-family: YuGothic, "游ゴシック体", "Yu Gothic", "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro", "メイリオ", Meiryo, "MS Pゴシック", "MS PGothic", sans-serif;
  line-height: 1.8;
  margin: 0;
  background: #fff;
}
p._a {
  font-size: 12px;
  font-weight: bold;
  margin: 30px 0 0;
}
p._a .link {
  display: inline-block;
  color: #607D8B;
  padding-left: 1.3em;
  text-indent: -1.3em;
}
p._a .link:before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-top: 2px solid #607D8B;
  border-right: 2px solid #607D8B;
  -webkit-transform: rotate(45deg);
  transform: rotate(45deg);
  margin-right: 10px;
}
header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: +1;
}
header h1 {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 22px;
  line-height: 2.0;
  padding: 0 .5em;
  height: 100px;
  margin: 3em 0 0;
  text-align: center;
  background: #FFEB3B;
}
section {
  background: #e5dfd3;
  padding: 120px 20px;
}
section .inner {
  max-width: 1024px;
  margin: 0 auto;
}
section .oneArea {
  margin-bottom: 200px;
}
section ul.list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  list-style-type: none;
  margin: 0 0 100px;
  padding: 0;
  box-sizing: border-box;
}
section ul.list li {
  width: calc(100% / 6);
  text-align: center;
}
section ul.list li a {
  display: block;
  padding: 10px;
  text-decoration: none;
  color: #fff;
  background: #333;
  border-right: 1px solid #fff;
  transition-duration: 0.3s;
}
section ul.list li:last-child a {
  border-right: none;
}
section ul.list li a:hover {
  opacity: 0.7;
}
section .oneArea .one_title {
  color: #fff;
  text-align: center;
  padding: 10px;
  background: #333;
}
section .oneArea a.button {
  display: block;
  font-size: 12px;
  color: #333333;
  text-align: center;
  background: #f2f2f2;
  padding: 10px;
  text-decoration: none;
  transition-duration: 0.3s;
  margin-top: 40px;
}
section .oneArea a.button:hover {
  opacity: 0.7;
}

              
            
!

JS

              
                // ページ内リンク
$(function(){
  $('a[href^=#]').click(function(){ // 通常のクリック時
    var href= $(this).attr("href"); // ページ内リンク先を取得
    var target = $(href);
    var position = target.offset().top;
    $('body,html').stop().animate({scrollTop:position}, 500); // スクロール速度ミリ秒
    return false;
  });
});
              
            
!
999px

Console