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

              
                <svg style="display: none;" xmlns="http://www.w3.org/2000/svg">
  <defs>
    <!-- 月アイコンを定義 -->
    <symbol id="icon_moon" viewBox="0 0 24 24">
      <path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
    </symbol>
    
    <!-- 星アイコンを定義 -->
    <symbol id="icon_star" viewBox="0 0 24 24">
      <polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon>
    </symbol>
  <defs>
</svg>

<!-- 月アイコン呼び出し -->
<div class="icon_moon--wrap">
  <svg class="-primary">
    <use href="#icon_moon"></use>
  </svg>
  <svg class="-red">
    <use href="#icon_moon"></use>
  </svg>
  <svg class="-blue">
    <use href="#icon_moon"></use>
  </svg>
</div>

<!-- 星アイコン呼び出し -->
<div class="icon_star--wrap">
  <svg class="-primary">
    <use xlink:href="#icon_star"></use>
  </svg>
  <svg class="-red">
    <use xlink:href="#icon_star"></use>
  </svg>
  <svg class="-blue">
    <use xlink:href="#icon_star"></use>
  </svg>
</div>

    
<!-- ▼▼月アイコン元コード▼▼
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
-->

<!-- ▼▼星アイコン元コード▼▼
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>
-->
              
            
!

CSS

              
                /* ======================
各アイコンの属性をCSSに記述
======================*/
#icon_moon {
  fill: none;
  stroke-width: 2;
  stroke: currentColor; /* colorプロパティで色指定できるようになる */
  stroke-linecap: round;
  stroke-linejoin: round;
}

#icon_star {
  fill: currentColor; /* colorプロパティで色指定できるようになる */
}

/* ======================
個別に色・サイズを指定
======================*/
.-primary {
  width: 24px;
  aspect-ratio: 1;
}

.-red {
  color: red;
  width: 32px;
  aspect-ratio: 1;
}

.-blue {
  color: blue;
  width: 48px;
  aspect-ratio: 1;
}
              
            
!

JS

              
                
              
            
!
999px

Console