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

              
                <!--
Some YouTube video embedding is allowed on specific domains only*, and codepen is whitelisted!
Just embed this Codepen URL instead of YouTube embed URL*:
https://cdpn.io/pen/debug/oNPzxKo?v=VIDEO_ID

* For example, https://www.youtube.com/watch?v=NAo38Q9c4xA can be only embedded in .com and .io domains (or maybe more, but not in .tw), besides those, it shows "Watch on YouTube" link in the iframe only.
* Support native YouTube embed parameters like autoplay, mute: https://developers.google.com/youtube/player_parameters

Example embed code:
```
<iframe src="https://cdpn.io/pen/debug/oNPzxKo?v=dYwto5oULSk" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen"><a href="https://www.youtube.com/watch?v=dYwto5oULSk target="_blank" rel="noopener">https://www.youtube.com/watch?v=dYwto5oULSk</a></iframe>
```
-->
<iframe src="https://www.youtube.com/embed/i3bpSKoFOqw?si=cEEi9nziWoJsuYAA" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="allowfullscreen"></iframe>
              
            
!

CSS

              
                html {
  overflow: hidden;
}
iframe {
  width: 100vw;
  height: 100vh;
}
              
            
!

JS

              
                (() => {
  const url = new URL(window.location)
  const vid = url.searchParams.get('v') ?? 'i3bpSKoFOqw?si=cEEi9nziWoJsuYAA'
  url.searchParams.delete('v')
  const embedUrl = new URL(`https://www.youtube.com/embed/${vid}?${url.searchParams.toString()}`)
  document.querySelector('iframe').src = embedUrl.href
})()
              
            
!
999px

Console