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


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.


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.


                <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");