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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

              
                  <div class="content">
    <ul>
      <li><a href="#titulo-1">Título 1</a></li>
      <li><a href="#titulo-2">Título 2</a></li>
    </ul>
    
    <h3 id="titulo-1">Título 1</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatem labore eos consequuntur, quaerat vitae quia animi recusandae. Itaque facere molestiae velit fugiat ipsum sit, deleniti repellat minima sed doloribus, accusantium, ratione incidunt nesciunt expedita accusamus corrupti harum vel quasi. Aut ipsum ratione et reiciendis cumque sequi eum possimus inventore, unde amet quis, quisquam est quaerat nesciunt laborum, voluptas ducimus iure, a fuga debitis! Veritatis, suscipit dolores repellat vero corporis sequi! Beatae, nostrum, reiciendis! Suscipit consectetur qui dolorem a temporibus voluptatum.</p>
    <h3 id="titulo-2">Título 2</h3>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Voluptatem labore eos consequuntur, quaerat vitae quia animi recusandae. Itaque facere molestiae velit fugiat ipsum sit, deleniti repellat minima sed doloribus, accusantium, ratione incidunt nesciunt expedita accusamus corrupti harum vel quasi. Aut ipsum ratione et reiciendis cumque sequi eum possimus inventore, unde amet quis, quisquam est quaerat nesciunt laborum, voluptas ducimus iure, a fuga debitis! Veritatis, suscipit dolores repellat vero corporis sequi! Beatae, nostrum, reiciendis! Suscipit consectetur qui dolorem a temporibus voluptatum.</p>
    <p>Código completo em: <a href="https://codecommit.com.br/smooth-scroll-suave-com-jquery/">https://codecommit.com.br/smooth-scroll-suave-com-jquery/</a></p>
  </div>
  
              
            
!

CSS

              
                .content { width:800px; margin:0px auto; }
              
            
!

JS

              
                $(function() {
  $('a[href*="#"]:not([href="#"])').click(function() {

    var target = $(this.hash);

    if (target.length) {
      $('html, body').animate({ scrollTop: target.offset().top }, 500);
      return false;
    }

  });
});
              
            
!
999px

Console