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="text-block">
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A sunt, labore, tempore corporis perspiciatis velit. At molestias aperiam ex culpa veniam, consectetur ratione, alias reiciendis, hic, ad voluptas facere quisquam!</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quos hic, vero voluptates facilis, veritatis neque nulla sint adipisci ut repellat, quo tenetur rem ab blanditiis? Fuga molestiae, cumque dignissimos voluptate.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Libero deserunt, voluptate aliquam eveniet quasi maiores recusandae nobis rerum placeat assumenda explicabo a in cum culpa possimus aspernatur autem, repellendus porro.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ad nesciunt dolore modi veritatis architecto expedita, vitae perferendis impedit ipsum iste. Repellat mollitia expedita quisquam, neque illum laboriosam, voluptate eligendi soluta.</p>
  </div>

              
            
!

CSS

              
                .text-block {
  width: 250px;
  margin: 50px;
}

#go-top {
  position: fixed; 
  bottom: 25px; 
  right: 70px;
  text-align: center;
  cursor:pointer; 
  display:none;
  width: 80px;
  height: 30px;
  background: #c0c0c0;
  line-height: 30px;
  border-radius: 5px;
}

#go-top:hover {
  background: #333;
  color: #fff;
}
              
            
!

JS

              
                $(document).ready(function(){
  $('body').append('<a href="#" id="go-top" title="Вверх">Вверх</a>');
});

$(function() {
 $.fn.scrollToTop = function() {
  $(this).hide().removeAttr("href");
  if ($(window).scrollTop() >= "250") $(this).fadeIn("slow")
  var scrollDiv = $(this);
  $(window).scroll(function() {
   if ($(window).scrollTop() <= "250") $(scrollDiv).fadeOut("slow")
   else $(scrollDiv).fadeIn("slow")
  });
  $(this).click(function() {
   $("html, body").animate({scrollTop: 0}, "slow")
  })
 }
});

$(function() {
 $("#go-top").scrollToTop();
});

              
            
!
999px

Console