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

              
                <!-- href属性には、ブックマークレットに登録したいコードを記述しておく -->
<!-- つまり外部のJavaScriptファイルを読み込む処理だけを記述 -->



<svg width="180px" height="169px" viewBox="0 0 180 169" xmlns:xlink="http://www.w3.org/1999/xlink">
  <path d="M78.6526731,78.8139678 L39.648926,0 L0,78.4913784 L24.6122528,72.2360609 C33.19463,158.594939 180,168.463287 180,168.463287 C180,168.463287 45.5977982,146.323177 50.8010359,72.3597413 L78.6526731,78.8139678 Z"></path>
</svg>

<a href="javascript:(function(){var s = document.createElement('script');s.src='https://codepen.io/mtmtkzm/pen/gxRQMj.js';document.body.appendChild(s);})()">LIGブログを沈める</a>

<style>
  /* 配付用ページの CSS(ブックマークレットの動作には関係がない) */
  svg {
    width: 180px;
    fill: #3f42af;
  }
  
  a {
    display: inline-block;
    padding: 15px 30px;
    color: white;
    background-color: #3f42af;
    border-radius: 5px;
    box-shadow: 0px 3px 16px 1px #3f42af;
    letter-spacing: .1em;
    text-decoration: none;
  }
</style>

              
            
!

CSS

              
                // CSSが必要な場合は、ここに書いてJSから読み込むこともできる
.underwater-container {
  width: 100vw;
  height: 100vh;
  background-image: url('https://cdn.liginc.co.jp/wp-content/uploads/2017/08/150246082462062000_62.jpg');
  background-size: cover;
  background-position: center center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  opacity: .2;
  pointer-events: none;
}
              
            
!

JS

              
                // ここは後から呼び出す外部ファイルの処理を書く。つまり外部ファイルそのもの。
let underwater = document.createElement('div');
underwater.innerHTML = `
  <link rel="stylesheet" href="https://codepen.io/mtmtkzm/pen/gxRQMj.css">
  <div class="underwater-container"></div>
`;
document.body.appendChild(underwater);

              
            
!
999px

Console