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>
  <a href="#dog">犬</a>
  <a href="#cat">猫</a>
  <a href="#okapi">オカピ</a>
</header>
<main>
  <section id="dog">
    <h2>犬について</h2>
    <p class="description">いつも楽しそうな顔をしている。<br>ゴールデンレトリバー・チワワ・ダックスフンドなど</p>
    <p>🐶🐶🐶🐶🐶🐶🐶🐶🐶🐶🐶🐶🐶🐶🐶🐶🐶🐶</p>
  </section>
  <section id="cat">
    <h2>猫について</h2>
    <p class="description">自由気ままな性格が多い。<br>スコティッシュフォールド・マンチカン・ラグドールなど</p>
    <p>🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱🐱</p>
  </section>
  <section id="okapi">
    <h2>オカピについて</h2>
    <p class="description">ウマのようであり、そしてシマウマのようでもある</p>
    <p>
      🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴🐴
    </p>
  </section>
</main>

<!-- あれ!?あれはオカピでしょ!! -->
              
            
!

CSS

              
                :root {
  --header-height: 70px;
}

html {
  scroll-behavior: smooth;
}

header {
  /* ヘッダーの高さ70pxを指定 */
  height: var(--header-height);
  position: fixed;
  top: 0;
  width: 100%;
}

section {
  /** スクロールスナップ領域を調整する */
  scroll-margin-top: var(--header-height);
}

/* 以下、その他のスタイル設定 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

header {
  background-color: rgba(255, 255, 255, 0.85);
  display: flex;
  gap: 20px;
  padding-left: 24px;
  padding-right: 24px;
  justify-content: center;
  align-items: center;
}

header a {
  color: black;
  display: block;
  font-size: 20px;
  font-weight: bold;
}

main {
  /* mainのmargin-topにヘッダーの高さを指定 */
  margin-top: var(--header-height);
}

section {
  text-align: center;
  font-size: 120px;
  padding: 24px;
}

h2 {
  font-size: 30px;
}

.description {
  font-size: 20px;
  margin-top: 6px;
}

section#dog {
  background-color: #c98df6;
}

section#cat {
  background-color: #f4481a;
}

section#okapi {
  background-color: #aee712;
}

/* オカピは知らない!! */

              
            
!

JS

              
                
              
            
!
999px

Console