Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              <div id="scroll-top">
  <button><span data-hover="Наверх"><i class="fa fa-arrow-up"></i></span></button>

<div class="content">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis malesuada vitae ex vitae aliquam. Maecenas pellentesque nunc a enim posuere, eget cursus turpis dignissim. Vestibulum ullamcorper, erat in posuere rutrum, felis ligula sagittis lacus, sed tristique purus est vel lorem. Nullam ornare eget sem eget suscipit. Aenean tempor urna purus, consequat laoreet mauris laoreet et. Praesent pulvinar, mauris vel vulputate blandit, arcu mi varius dolor, a eleifend purus purus nec turpis. Proin orci nisi, egestas sit amet varius sodales, pulvinar vitae arcu. Nulla non lacinia libero. Nam sit amet magna dolor. Nam feugiat augue vitae venenatis iaculis. Donec ullamcorper eros ut malesuada sollicitudin.
Vivamus eu erat in tellus posuere congue. Sed fermentum urna in rutrum fringilla. Donec pretium finibus sem. In id elit quam. Aliquam vel semper magna. Cras euismod velit ut sapien hendrerit, in commodo ipsum volutpat. Sed eget dolor at tortor venenatis mollis. Nulla neque lorem, lobortis in nunc a, molestie scelerisque diam. Nam eget metus varius, consectetur tortor eget, consequat metus. Etiam a dui eget neque scelerisque semper. Quisque placerat purus arcu, sit amet fringilla sem faucibus pharetra. Aliquam a nisi auctor, vehicula tortor ut, imperdiet mi. Cras vestibulum sapien mi, eget accumsan mi sollicitudin tempor. Vestibulum tristique et libero ac congue.
Nam eget eleifend dolor, imperdiet sagittis nulla. Proin vestibulum varius sapien, nec condimentum lacus. Vestibulum venenatis odio et urna ornare, quis ultricies velit congue. Praesent sed purus suscipit, feugiat sem sed, euismod velit. Sed ac diam hendrerit, luctus arcu vitae, dignissim ligula. Nam ac leo vel erat auctor iaculis sed ac sem. Donec a nisi turpis. Donec consectetur at lacus vulputate egestas. Nunc fermentum neque vel vestibulum congue. Aliquam felis mauris, tincidunt nec diam sit amet, elementum sagittis diam. Quisque ut posuere orci. Maecenas sed viverra eros. Sed ac felis volutpat, dignissim nunc sed, hendrerit lacus.
Duis sagittis ipsum sapien, ac egestas nibh cursus nec. Donec vel fringilla risus. In maximus felis sit amet nisi vestibulum volutpat. Pellentesque facilisis dignissim augue at sodales. Proin eget tempus massa. Vestibulum dapibus diam sed libero laoreet fermentum. Phasellus viverra quam sed leo sodales, gravida posuere magna laoreet. Integer vestibulum arcu non lobortis pretium.
Curabitur commodo turpis eu rutrum laoreet. Etiam mollis sem in nisi blandit, ut vestibulum leo blandit. Quisque aliquam venenatis eros a tristique. Cras at sapien cursus, rutrum est vitae, commodo neque. Aliquam in consequat erat. Aenean dignissim nibh eget ullamcorper tempor. Etiam a semper massa, at congue lacus.
              @import url(;

body {
  background: #efefef;
  font-family: Roboto;

.content {
  height: 400px;
  line-height: 1.5;
  width: 90%;
  margin: 24px auto;
  color: rgba(0, 0, 0, 0.8);

#scroll-top {
  position: fixed;
  bottom: 48px;
  right: 48px;

#scroll-top button {
  position: relative;
  overflow: hidden;
  height: 48px;
  width: 48px;
  border: none;
  outline: none;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.3);
  font-size: 16px;
  background: #21c984;
  transition: width 0.5s;
  border-radius: 100px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);

#scroll-top button span {
  display: inline-block;
  transition: opacity 0.3s ease 0s, transform 0.5s ease 0s;
  line-height: 48px;
  font-size: 20px;
  width: 100%;

#scroll-top button span::before {
  width: 100%;
  position: absolute;
  left: 0px;
  top: 200%;
  opacity: 0;
  content: attr(data-hover);
  -webkit-transform: translate3d(0, 0, 0);
  -moz-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  color: #fff;
  font-size: 16px;
  text-transform: uppercase;

#scroll-top:hover button {
  width: 120px;
  background: #9b59b6;

#scroll-top:hover button span {
  -webkit-transform: translateY(-200%);
  -moz-transform: translateY(-200%);
  transform: translateY(-200%);

#scroll-top:hover button span:before {
  opacity: 1;

#scroll-top button:active {
  background: #21c984;

              jQuery(document).ready(function($) {
  $('html, body').scrollTop($(document).height());
  $("#scroll-top > button").on("click", function(e) {
    var body = $("html, body");
    body.stop().animate({ scrollTop: 0 }, 500, "swing");

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.