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

              
                <!--▼縦書き固定サイドメニュー▼-->
<div class="side-menu">
  <ul class="menu">
    <li><a href="#service">サービス</a></li>
    <li><a href="#price">料金</a></li>
    <li><a href="#voice">お客様の声</a></li>
    <li><a href="#contact">お問い合わせ</a></li>
  </ul>
</div>
<!--▲縦書き固定サイドメニュー▲-->

<section id="service"><h2>サービス</h2></section>
<section id="price"><h2>料金</h2></section>
<section id="voice"><h2>お客様の声</h2></section>
<section id="contact"><h2>お問い合わせ</h2></section>

<!-- jQueryを読み込み -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
              
            
!

CSS

              
                /* リセット */
body{
  margin:0;
}

h2 {
  text-align:center;
  color:#fff;
  font-weight:normal;
  padding:30px;
  margin:0;
}

a {
  background-color: transparent;
  color: inherit;
  text-decoration: none;
  -webkit-text-decoration-skip: objects;
}
ul {
  list-style: none;
}


/* 背景 */
section{
  height:100vh;
  margin:0;
  padding:0;
}

#service {
  background:#F6D580;
}

#price {
  background:#95DFD6;
}

#voice {
  background:#ECACB5;
}

#contact {
  background:#9ACDE7;
}
/* 追従のサイドメニュー */
.side-menu {
  position: fixed;
  top: 20vh;
	right:0;
	z-index:1;
  font-size:0px;
}

.side-menu li a{
	color:#9F886E;
  font-size:1rem;
	padding:20px 24px;
	background-color: rgba(255,255,255,0.7);
	-webkit-writing-mode: vertical-rl;
      -ms-writing-mode: tb-rl;
          writing-mode: vertical-rl;
}

.side-menu  li a:hover {
	background:#9F886E;
	color:#fff;
}

@media only screen and (max-width: 767px){
	.side-menu li a {
    padding:10px 17px;
		 font-size: 0.875em;
		}
              
            
!

JS

              
                // スムーズスクロールの実装
$(function(){
	$('a[href^=#]').click(function(){
		var speed = 500;
		var href= $(this).attr("href");
		var target = $(href == "#" || href == "" ? 'html' : href);
		var position = target.offset().top;
		$("html, body").animate({scrollTop:position}, speed, "swing");
		return false;
	});
});
              
            
!
999px

Console