Pen Settings



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


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.


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.


                <form class="slider" action="">
  <label class="sr-only" for="range">Change width</label>
  <input type="range" name="" id="range" min="300" max="1100">

<div class="test-wrapper" style="width: 320px">
  <div class="card">
    <div class="card__thumb"></div>
    <div class="card__content">
      <h3 class="card__title">
        Inspect Element As A Way To Feed Your Curiosity
      <p class="card__desc">
        One of the best gifts we have as front-end developers is inspect

<div class="note">
  <p>This is a demo from the <a href="">query units</a> article by Ahmad Shadeed</p>


                .test-wrapper {
  container: inline-size;
  margin: 1rem auto;
  max-width: 100%;
  outline: solid 1px lightgrey;
  outline-offset: 10px;

.card {
  display: flex;
  flex-direction: column;
  gap: calc(0.5rem + 1qmin);

.card__thumb {
  aspect-ratio: 4 / 3;
  flex: 0 0 30%;
  background-color: #4caf4c;
  border-radius: 7px;
  min-width: 0;
  object-fit: cover;

.card__title {
  font-weight: 500;
  font-size: clamp(1.25rem, 5qmin, 2.5rem);
  margin-bottom: 0.5rem;

.card__content {
  flex: 1;

.card__desc {
  color: #6b6b6a;

.slider {
  max-width: 500px;
  margin: 2rem auto 3rem;

  input {
    width: 100%;

.note {
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;

body {
  padding: 1rem;
  font-family: "Rubik";
  line-height: 1.4;

*:after {
  box-sizing: border-box;



                let slider = document.querySelector("#range");
let wrapper = document.querySelector(".test-wrapper");

slider.value = 300;

slider.addEventListener("input", (e) => { = `${e.currentTarget.value}px`;