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="contents">
  <p class="no-support">
    This browser doesn't support <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_scroll-driven_animations">CSS scroll-driven animations</a> yet.
  </p>
  <header>
    <h1>Ozymandias</h1>
    <p>Percy Bysshe Shelley</p>
  </header>
  <main>
    <p>I met a traveller from an antique land</p>
    <p>Who said: Two vast and trunkless legs of stone</p>
    <p>Stand in the desert. Near them on the sand,</p>
    <p>Half sunk, a shattered visage lies, whose frown</p>
    <p>And wrinkled lip and sneer of cold command</p>
    <p>Tell that its sculptor well those passions read</p>
    <p>Which yet survive, stamped on these lifeless things,</p>
    <p>The hand that mocked them and the heart that fed.</p>
    <p>And on the pedestal these words appear:</p>
    <p>"My name is Ozymandias, King of Kings:</p>
    <p>Look on my works, ye mighty, and despair!"</p>
    <p>Nothing beside remains. Round the decay</p>
    <p>Of that colossal wreck, boundless and bare,</p>
    <p>The lone and level sands stretch far away.</p>
  </main>
</div>
              
            
!

CSS

              
                .contents {
  color: navy;
  font-family: sans-serif;
  margin: 0 auto;
  max-width: max-content;
}

header {
  padding-top: 45dvh;
  padding-bottom: 50dvh;
}

h1 {
  font-size: 3rem;
  margin: 0;
}

header p {
  margin-top: 0.25rem;
}

main {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  padding-bottom: 90dvh;
}

main::after {
  background-color: currentColor;
  content: " ";
  display: block;
  height: 8px;
  width: 100px;
}

@keyframes write {
  0% {
    clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
  }

  100% {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  }
}

text {
  font-family: "Homemade Apple", cursive;
  stroke: currentColor;
  stroke-width: 2px;
}

main p {
  font-family: "Homemade Apple", cursive;
  font-size: clamp(1rem, 3.25vw, 2rem);
  margin: 0;
  padding: 20dvh 0.1rem 35dvh 0.2rem;

  view-timeline-name: --written-text;
  view-timeline-axis: block;
  animation-name: write;
  aimation-timing-function: linear;
  animation-direction: both;
  animation-timeline: --written-text;
  animation-range: entry-crossing 30% contain 45%;
}

.no-support {
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 1rem;
}

@supports (timeline-scope: none) {
  .no-support {
    display: none;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console