Pen Settings

HTML

CSS

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

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

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.

HTML

              
                <p>Author : <a href="http://neo.s21.xrea.com/">Neo</a></p>
<ul>
  <li><code>@font-face</code> 使用時、どのぐらい <code>font-weight</code> 指定が必要か調べるために作った。</li>
  <li><code>Yu Gothic M1</code> は <code>font-weight</code> なしと <code>bold</code> のみ記述。</li>
  <li><code>Yu Gothic M2</code> は 100 ずつウェイトを指定して9つ記述。</li>
  <li>Windows Firefox・Mac Chrome だとどちらも同じ見た目になった。</li>
</ul>

<p>
  <button type="button" id="toggle-btn">重ねる</button>
  <button type="button" id="colour-btn">色分け</button>
</p>

<div class="wrapper">
  <div class="y1-wrapper">
    <div class="y1" style="font-weight: 100;">游ゴシック Yu Gothic</div>
    <div class="y1" style="font-weight: 200;">游ゴシック Yu Gothic</div>
    <div class="y1" style="font-weight: 300;">游ゴシック Yu Gothic</div>
    <div class="y1" style="font-weight: 400;">游ゴシック Yu Gothic</div>
    <div class="y1" style="font-weight: 500;">游ゴシック Yu Gothic</div>
    <div class="y1" style="font-weight: 600;">游ゴシック Yu Gothic</div>
    <div class="y1" style="font-weight: 700;">游ゴシック Yu Gothic</div>
    <div class="y1" style="font-weight: 800;">游ゴシック Yu Gothic</div>
    <div class="y1" style="font-weight: 900;">游ゴシック Yu Gothic</div>
  </div>
  <div class="y2-wrapper">
    <div class="y2" style="font-weight: 100;">游ゴシック Yu Gothic</div>
    <div class="y2" style="font-weight: 200;">游ゴシック Yu Gothic</div>
    <div class="y2" style="font-weight: 300;">游ゴシック Yu Gothic</div>
    <div class="y2" style="font-weight: 400;">游ゴシック Yu Gothic</div>
    <div class="y2" style="font-weight: 500;">游ゴシック Yu Gothic</div>
    <div class="y2" style="font-weight: 600;">游ゴシック Yu Gothic</div>
    <div class="y2" style="font-weight: 700;">游ゴシック Yu Gothic</div>
    <div class="y2" style="font-weight: 800;">游ゴシック Yu Gothic</div>
    <div class="y2" style="font-weight: 900;">游ゴシック Yu Gothic</div>
  </div>
</div>

              
            
!

CSS

              
                @font-face { font-family: "Yu Gothic M1"; src: local("Yu Gothic Medium"); }
@font-face { font-family: "Yu Gothic M1"; src: local("Yu Gothic Bold"); font-weight: bold; }

@font-face { font-family: "Yu Gothic M2"; src: local("Yu Gothic Medium"); font-weight: 100; }
@font-face { font-family: "Yu Gothic M2"; src: local("Yu Gothic Medium"); font-weight: 200; }
@font-face { font-family: "Yu Gothic M2"; src: local("Yu Gothic Medium"); font-weight: 300; }
@font-face { font-family: "Yu Gothic M2"; src: local("Yu Gothic Medium"); font-weight: 400; }
@font-face { font-family: "Yu Gothic M2"; src: local("Yu Gothic Medium"); font-weight: 500; }
@font-face { font-family: "Yu Gothic M2"; src: local("Yu Gothic Bold"); font-weight: 600; }
@font-face { font-family: "Yu Gothic M2"; src: local("Yu Gothic Bold"); font-weight: 700; }
@font-face { font-family: "Yu Gothic M2"; src: local("Yu Gothic Bold"); font-weight: 800; }
@font-face { font-family: "Yu Gothic M2"; src: local("Yu Gothic Bold"); font-weight: 900; }

.y1 { font-family: "Yu Gothic M1", "MS P明朝", "MS PMincho", serif; }
.y2 { font-family: "Yu Gothic M2", "MS P明朝", "MS PMincho", serif; }

.wrapper { position: relative; font-size: 1.7rem; }
.wrapper.side-by-side { display: grid; grid-template-columns: 1fr 1fr; }
.wrapper:not(.side-by-side) > div { position: absolute; }

.colour-blue { color: rgba(0, 0, 255, .9); }
.colour-red  { color: rgba(255, 0, 0, .9); }

ul { font-size: .8rem; }
              
            
!

JS

              
                document.addEventListener('DOMContentLoaded', () => {
  document.getElementById('toggle-btn').addEventListener('click', () => {
    document.querySelector('.wrapper').classList.toggle('side-by-side');
  });
  document.getElementById('colour-btn').addEventListener('click', () => {
    document.querySelector('.y1-wrapper').classList.toggle('colour-blue');
    document.querySelector('.y2-wrapper').classList.toggle('colour-red');
  });
});
              
            
!
999px

Console