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

              
                <header class="size">
  in faucibus orci luctus et ultrices posuere cubilia curae; Fusce non eleifend ipsum. Class aptent Nulla finibus tempor dignissim. In nec faucibus eros, sit amet ultricies ante. Vestibulum ante</header>
<main>
  <aside class="size">
    <img src="https://picsum.photos/id/115/200/150">
    <img src="https://picsum.photos/id/120/200/150">
  </aside>
  <section class="size">
    <h1>Class aptent taciti</h1>
    <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin suscipit vulputate egestas. Nulla finibus tempor dignissim. In nec faucibus eros, sit amet ultricies ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Fusce non eleifend ipsum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nulla maximus facilisis mi, non varius leo. Etiam ac elit bibendum, varius sem quis, condimentum sapien. Phasellus tincidunt augue ut ligula rhoncus commodo. Mauris felis lectus, convallis id posuere nec, iaculis a est.</p>
  </section>
</main>
<footer class="size"> in faucibus orci luctus et ultrices posuere cubilia curae; Fusce non eleifend ipsum. Class aptent</footer>
              
            
!

CSS

              
                @property --_x {
  syntax: "<number>";
  inherits: true;
  initial-value: 0; 
}
@property --_y {
  syntax: "<number>";
  inherits: true;
  initial-value: 0; 
}
@property --w {
  syntax: "<integer>";
  inherits: true;
  initial-value: 0; 
}
@property --h {
  syntax: "<integer>";
  inherits: true;
  initial-value: 0; 
}

.size {
  overflow: auto;
  position: relative;
  --w:calc(1/(1 - var(--_x)));
  --h:calc(1/(1 - var(--_y)));
  timeline-scope: --cx,--cy;
  animation: x linear,y linear;
  animation-timeline: --cx,--cy;
  animation-range: entry 100% exit 100%; 
}
.size:before {
  content:"";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  aspect-ratio: 1;
  view-timeline: --cx inline,--cy block;
}
@keyframes x {to{--_x:1}}
@keyframes y {to{--_y:1}}

.size:after {
  content: counter(w) "x" counter(h);
  counter-reset: w var(--w) h var(--h);
  position: absolute;
  left: 0;
  top: 0;
  background: #000;
  color: #fff;
  font-size: 23px;
  font-weight: bold;
  padding: .3em;
}

body {
  font-family: system-ui, sans-serif;
  font-size: 1.2em;
}
main {
  display: grid;
  grid-template-columns: 1fr 3fr;
}

header,
aside,
section,
footer {
  border: 2px solid;
  margin: 5px;
  padding: 10px;
}
img {
  width: 100%;
}
              
            
!

JS

              
                
              
            
!
999px

Console