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

              
                <div class="oya">
</div>
<br><br>
<div class="oya">
<iframe class="youtube_1" width="560" height="315" src="https://www.youtube.com/embed/TNNir3sNV_E" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><!-- YouTube アスペクト比率16:9 埋め込みコード -->
</div>
<br><br>
<div class="oya">
<iframe class="youtube_2" width="560" height="315" src="https://www.youtube.com/embed/TNNir3sNV_E" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><!-- YouTube アスペクト比率16:9 埋め込みコード -->
</div>
              
            
!

CSS

              
                
.oya {
  background-color:#0EBEFF;
  position: relative;
  width: 100%;
  height: 0;
  padding-top:56.25%; /*幅をYoutubeの標準アスペクト比率16:9にあわせる 9/16=0.5625。 oyaの幅にこの9/16をかけると、oyaの高さが計算され、それにあわせてoyaのサイズがきまる。*/
}

.oya iframe.youtube_1 {
  position: absolute; /* oyaにposition:relativeがあるので、iframeの基準座標は、ブラウザのウインドウではなくoya要素。そして以下の座標軸について絶対配置*/
  top: 0; /*Y座標軸*/
  left: 0; /*X座標軸*/
  width:100%; /*親要素の幅そのまま*/
  height:100%; /*親要素の高さそのまま*/
}
.oya iframe.youtube_2 {
  position: absolute; /* oyaにposition:relativeがあるので、iframeの基準座標は、ブラウザのウインドウではなくoya。そして以下の座標軸について絶対配置*/
  top: 0; /*Y座標軸*/
  left: 0; /*X座標軸*/
  width:50%; /*oyaの幅の半分*/
  height:50%; /*oyaの高さの半分*/
}

              
            
!

JS

              
                
              
            
!
999px

Console