css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div id="wrapper">
  <h1>font-family Tests</h1>
  <p>Author : <a href="http://neo.s21.xrea.com/">Neo</a></p>
              *, ::before, ::after {
  box-sizing: border-box;

html {
  width: 100%;
  height: 100%;
  color: #000;
  font-size: 16px;
  background: #fff;

body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.5;

/* iPhone Safari で CodePen がスクロールできなかったので子要素でスクロールさせる */
#wrapper {
  padding: .5rem;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;

h1, h2, p {
  margin: 0 0 1rem;

h1 {
  font-size: 2rem;

h2 {
  font-size: 1.5rem;

.fonts {
  margin: 1rem 0;
  border-top: 1px solid #ccc;
  padding-top: 1rem;

.fallback {
  font-size: 1rem;
  font-weight: normal;

.font {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: .5rem;
  font-size: 1.2rem;
  white-space: nowrap;

.font-example, .font-name {
  overflow: hidden;
              const fonts = [
    family: 'sans-serif',
    fallback: '"游明朝体", YuMincho, "游明朝", "Yu Mincho", serif',
    names: [
      '"Yu Gothic"',
      '"游ゴシック Medium"',
      '"Yu Gothic Medium"',
      '"ヒラギノ角ゴ ProN W3"',
      '"Hiragino Kaku Gothic ProN W3"',
      '"ヒラギノ角ゴ ProN"',
      '"Hiragino Kaku Gothic ProN"',
      '"ヒラギノ角ゴ Pro"',
      '"Hiragino Kaku Gothic Pro"',
      '"MS Pゴシック"',
      '"MS PGothic"',
      '"Helvetica Neue"',
      '"Segoe UI"'
    family: 'serif',
    fallback: '"游ゴシック体", YuGothic, "游ゴシック", "Yu Gothic", sans-serif',
    names: [
      '"Yu Mincho"',
      '"ヒラギノ明朝 ProN W3"',
      '"Hiragino Mincho ProN W3"',
      '"ヒラギノ明朝 ProN"',
      '"Hiragino Mincho ProN"',
      '"ヒラギノ明朝 Pro"',
      '"Hiragino Mincho Pro"',
      '"MS P明朝"',
      '"MS PMincho"',
      '"Times New Roman"'
    family: 'monospace',
    fallback: '"游明朝体", YuMincho, "游明朝", "Yu Mincho", serif',
    names: [
      '"Ricty Diminished"',
      '"MS ゴシック"',
      '"MS Gothic"',
      '"Courier New"',
      '"Lucida Console"'

const appendFonts = (fontData) => {
  const family   = fontData.family;
  const fallback = fontData.fallback;
  let style = '<style>';
  let html  = `<div class="fonts"><h2>${family} <small class="fallback">(Fallback : ${fallback})</small></h2>`;
  fontData.names.forEach((name, index) => {
    const className = `${family}-${index}`;
    style += `.${className} { font-family: ${name}, ${fallback}; }`;
    html  += `<div class="font ${className}"><div class="font-example ${className}">2019-01-01 Lorem Ipsum テスト文字列</div><div class="font-name ${className}">${name}</div></div>`;
  style += '</style>';
  html  += '</div>';
  document.querySelector('#wrapper').insertAdjacentHTML('beforeend', `${style}${html}`);

document.addEventListener('DOMContentLoaded', () => {
  fonts.forEach((fontData) => {
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................