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.


  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <link rel="stylesheet" type="text/css" href="">


  <header id="header">
  <p class="caution">ページ内リンクをクリックすると<br>それぞれの場所に移動します<br>↓ ↓ ↓</p>

  <ul id="page-link">
    <li><a href="#area-1">名言 1</a></li>
    <li><a href="#area-2">名言 2</a></li>
    <li><a href="#area-3">名言 3</a></li>

    <section class="area" id="area-1">
      <h2>名言 1</h2>
    <section class="area" id="area-2">
      <h2>名言 2</h2>
    <section class="area" id="area-3">
      <h2>名言 3</h2>
      <p>「負けたことがある」というのが いつか 大きな財産になる</p>

  <footer id="footer">
    <p id="page-top"><a href="#">Page Top</a></p>
    <small>&copy; copyright.</small>

  <script src="" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
  <script src=""></script>


                @charset "utf-8";

/*========= ページトップのためのCSS ===============*/

#page-top a {
  background: #942d2f;
  display: block;
  padding: 20px;
  width: 100%;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.3s;

#page-top a:hover {
  background: #777;

/*========= ヘッダー追従のためのCSS ===============*/

#header {
  position: fixed; /*追従ナビのためpositionをfixedにする*/
  top: 0; /*ポジション設定topを0*/
  height: 70px; /*headerの高さを指定*/
  width: 100%; /*position:fixed;にしたため、横幅100%を設定*/
  background: #333;
  color: #fff;
  text-align: center;
  padding: 20px;

/*========= レイアウトのためのCSS ===============*/

body {
  width: 100%;
  height: 100vh;
  vertical-align: middle;

h1 {
  font-size: 1.2rem;

h2 {
  font-size: 1.2rem;
  text-align: center;
  margin: 0 0 30px 0;

p {
  margin-top: 20px;

small {
  background: #333;
  color: #fff;
  display: block;
  text-align: center;
  padding: 20px;

section {
  padding: 10vh 30px;

section:nth-child(2n) {
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;

  background-image: linear-gradient(
    rgba(255, 255, 255, 1) 5%,
    rgba(252, 225, 208, 1) 15%,
    rgba(255, 173, 214, 1) 50%,
    rgba(162, 186, 245, 0.8) 80%,
    rgba(255, 255, 255, 1) 95%

.caution {
  margin-top: 10px;
  color: red;
  text-align: center;
  font-size: clamp(12px, 2.5vw, 1.2rem);
  font-weight: bold;
  white-space: nowrap;
  width: 100%; /*position:fixed;にしたため、横幅100%を設定*/

#page-link {
  display: flex;
  justify-content: center;
  padding: 20px;

#page-link li {
  list-style: none;

#page-link li a {
  color: #333;
  padding: 0 20px;
  text-decoration: none;

#page-link li a::before {
  content: "▼";
  font-size: 0.8rem;
  padding: 0 10px 0 0;
  color: #ccc;

#footer {
  position: relative;
  z-index: 2;



                // #page-linkの#area-*をクリックした際の設定
$('#page-link a[href*="#"]').click(function () {
  var elmHash = $(this).attr("href"); //ページ内リンクのHTMLタグhrefから、リンクされているエリアidの値を取得
  var pos = $(elmHash).offset().top - 70; //idの上部の距離からHeaderの高さを引いた値を取得
  $("body,html").animate({ scrollTop: pos }, 1500, "easeOutCirc"); //取得した位置にスクロール。1500の数値が大きくなるほどゆっくりスクロール
  return false;

// #page-topをクリックした際の設定
$("#page-top").click(function () {
      scrollTop: 0 //ページトップまでスクロール
  ); //ページトップスクロールの速さ※数字が大きいほど遅くなる, easingプラグインでアニメーション速度に変化
  return false; //リンク自体の無効化