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="scrollable-reverse">
  <div class="snap-to-bottom">
    <p>This is <a href="https://codepen.io/KittyGiraudel/pen/ZEPgJEM" target="_top">a fork from a Codepen by Kitty Giraudel,</a> both pens have the same title, namely <q>CSS-only bottom-anchored scrolling area</q>.</p>
    <p>The difference is, this pen has an additional wrapper that eliminates the need for a reverse order.</p>
    <p>In doing that, the not so intuitive text selection is also gone. Kudos to Kitty for their <a href="https://kittygiraudel.com/2024/02/26/css-only-bottom-anchored-scrolling-area/" target="_top">inspiring blog post,</a> it would’ve never occured to me that flex’s <code>column-reverse</code> leads to bottom-anchored content inside a scrollable container.</p>
  </div>
</div>

              
            
!

CSS

              
                .scrollable-reverse {
  display: flex;
  flex-direction: column-reverse;
  overflow: auto;
}
.snap-to-bottom {
  /* nothing needed here, but this is where the content goes */
}

/* unimportant stuff below */ 

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font: 100%/1.5 sans-serif;
}
body {
  max-width: 18rem;
  margin-block: 0;
  margin-inline: auto;
  padding-block: 1rem 5rem;
  padding-inline: .25rem;
}
.scrollable-reverse {
  max-block-size: 8.5lh;
  border: .0625rem solid;
  padding: 1lh 1.5rem;
}
p {
  margin-block: 0;
}
p + p {
  margin-block: 1lh 0;
}

              
            
!

JS

              
                
              
            
!
999px

Console