Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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

              
                .header
  h1 Magic Line Menu
  
.menu
  .menu-item.current-menu-item
    h6 Home
    .wee
  .menu-item
    h6 Short
  .menu-item
    h6 Longer Navigation
  .menu-item
    h6 Random
  .menu-item
    h6 Follow
    
.me
  a(href="https://github.com/cmdeveloped" target="_blank")
    <i class="fab fa-github"></i>
  a(href="https://twitter.com/collinscode_" target="_blank")
    <i class="fab fa-twitter"></i>
  a(href="https://codepen.io/collinscode" target="_blank")
    <i class="fab fa-codepen"></i>
  a(href="https://linkedin.com/in/cmdeveloped" target="_blank")
    <i class="fab fa-linkedin-in"></i>
              
            
!

CSS

              
                primaryfont = 'Montserrat', sans-serif

html
  body
    position relative
    background #ECE9E6  /* fallback for old browsers */
    background -webkit-linear-gradient(to right, #FFFFFF, #ECE9E6)  /* Chrome 10-25, Safari 5.1-6 */
    background linear-gradient(to right, #FFFFFF, #ECE9E6) /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
    font-family primaryfont
    height 100vh
    display flex
    align-items center
    justify-content center
    .header
      position absolute
      top 2rem
      left 50%
      transform translateX(-50%)
      color #002b75
    .menu
      width 100%
      display flex
      align-items center
      justify-content center
      .menu-item
        position relative
        cursor pointer
        .wee
          height 2px
          width 100%
          background-color #002b75
          position absolute
          left 0
          bottom 0
          transition 0.75s
        h6
          margin 0
          padding 0 1rem 1.5rem
          font-size 1rem
          color #232323
          transition 0.75s
        &:hover
          h6
            color #002b75
      .current-menu-item
        h6
          color #002b75
          
.me
  position absolute
  bottom 5rem
  left 50%
  transform translateX(-50%)
  a
    display inline-block
    padding 0.25rem
    margin 0 0.25rem
    color #232323
    font-size 1.5rem
    transition 0.75s
    &:hover
      color #002b75
              
            
!

JS

              
                $(document).ready(function() {
  // cool nav menu
  $(window).on('load resize', function() {
    var $thisnav = $('.current-menu-item').offset().left;

    $('.menu-item').hover(function() {
      var $left = $(this).offset().left - $thisnav;
      var $width = $(this).outerWidth();
      var $start = 0;
      $('.wee').css({ 'left': $left , 'width': $width });
    }, function() {
      var $initwidth = $('.current-menu-item').width();
      $('.wee').css({ 'left': '0' , 'width': $initwidth });
    });
  });

});
              
            
!
999px

Console