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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <h1>1 box with a <b>16:9 aspect ratio</b></h1>

<div class="container content aspect-ratio">
  Perfect solution with <b>aspect-ratio</b>

<p>Why just one box? Thanks to aspect-ratio, this is the last box you’ll ever need. No more <a href="" target="_top">CSS hacks</a> like the ones we had to use in the past. </p>



                .aspect-ratio {
  aspect-ratio: 16 / 9;

/* the following two declarations are for non-supporting browsers */
p::after {
  content: "That said, the box above has no 16:9 aspect ratio after all, because your particular browser does not support aspect-ratio, so it still needs those hacks. 😭 \0a Follow the links to learn more.";
  padding: 0 .25ch;
  background-color: #c11;
  font-weight: 700;
  color: #fff;
  white-space: pre-wrap;
@supports (aspect-ratio: 1) {
  p::after {
    content: none;

/* everything below here is just for looks */
body {
  width: 16em;
  margin: 2em auto;
  text-align: center;
h1 {
  font-size: 150%;
  line-height: 1;
.content {
  padding: 1em;
  background: #ccc;
  border: 1px dashed #000;
  color: #000;
.container {
  margin-top: 2em;
b {
  display: block;
p {
  text-align: left;

*::after {
	box-sizing: inherit;
	margin: 0;
html {
	box-sizing: border-box;
	color: #000;
	font: 100%/1.5 sans-serif;