Pen Settings

HTML

CSS

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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

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.

HTML

              
                    <div class="slider">
      <div class="price"><sup class="currency">$</sup><span class="dollars">16.00</span></div>
      <input
        type="range"
        id="price--range"
        name="price--range"
        min="0"
        max="100"
        value="16"
        step="0.01"
      />
      <label class="sr-only" for="price--range">Price</label>
      <button class="" name="buy" type="button">Buy now</button>
    </div>

              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@700&display=swap");

:root {
  --background-dark-gray: #262529;
  --gold: #ffc700;
  --pink: #ea346f;
  --progress-bar-gray: #4d4c53;
  --button-color: #333139;
}

body {
  background-color: black;
  font-family: "Source Sans Pro", sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.slider {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  background-color: var(--background-dark-gray);
  padding: 60px;

  box-shadow: 0px 0px 250px #000000;
  border-radius: 20px;
  width: 80vw;
}

.price {
  font-size: 6rem;
  font-weight: 700;
  line-height: 118px;
  color: #ffc700;
  margin-bottom: 70px;
}
sup {
  font-size: 4rem;
  line-height: 82px;
}
[name="price--range"] {
  margin-bottom: 70px;
  width: 100%;
}
[name="buy"] {
  font-weight: 700;
  font-size: 30px;
  line-height: 38px;
  text-align: center;
  letter-spacing: 0.15em;
  color: #ffffff;

  text-transform: uppercase;
  background-color: var(--button-color);
  padding: 34px 52px;
  border-radius: 100px;
}

[name="buy"]:focus,
[name="buy"]:hover {
  background-color: var(--pink);
}

input[type=range] {
  -webkit-appearance: none; /* Hides the slider so that custom slider can be made */
  appearance: none; /* Hides the slider so that custom slider can be made */
  width: 100%; /* Specific width is required for Firefox. */
  background: transparent; /* Otherwise white in Chrome */
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none; 
}

input[type=range]:focus {
  outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */
}

input[type=range]::-ms-track {
  width: 100%;
  cursor: pointer;

  /* Hides the slider so custom styles can be added */
  background: transparent; 
  border-color: transparent;
  color: transparent;
}

input[type="range"] {
  background-color: var(--progress-bar-gray);
  border-radius: 10px;
  height: 14px;
  cursor: pointer;

  width: 100%;
  border: 0px solid #000101;
  border-radius: 10px;
}

input[type="range"]::-webkit-slider-runnable-track {
}

input[type="range"]::-webkit-slider-thumb {
  box-shadow: 0px 2px 50px var(--pink);
  width: 52px;
  height: 52px;
  background: var(--pink);
  border: 15px solid rgba(234, 52, 111, 0.2);
  border-radius: 26px;
  cursor: pointer;
  -webkit-appearance: none;
}
input[type="range"]::-moz-range-thumb {
  box-shadow: 0px 2px 50px var(--pink);
  margin-top: -18px;
  width: 52px;
  height: 52px;
  background: var(--pink);
  outline: 15px solid rgba(234, 52, 111, 0.2);
  border-radius: 50%;
  border:0;
  cursor: pointer;
  -webkit-appearance: none;
}
input[type="range"]::-moz-range-progress {
  background: #EA346F;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  height: 14px;
  box-shadow: 0px 2px 25px var(--pink);

}

              
            
!

JS

              
                    /*
      Need to padEnd the cents
    */
    const slider = document.querySelector('input[name="price--range"]');
    const sliderValue = document.querySelector('.price .dollars');

    slider.addEventListener('change', updateValue);

    function updateValue(e) {
      sliderValue.textContent = e.target.value;
    }

              
            
!
999px

Console