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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                  <nav>
      <ul>
<li class="logo">CodingNepal</li>
<li class="items"><a href="#">Home</a></li>
<li class="items"><a href="#">About</a></li>
<li class="items"><a href="#">Blogs</a></li>
<li class="items"><a href="#">Contact</a></li>
<li class="items"><a href="#">Feedback</a></li>
<li class="btn"><a href="#"><i class="fas fa-bars"></i></a></li>
</ul>
</nav>


<section>
  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lacus arcu, tristique sed dui ut, vestibulum tempor augue. Nunc facilisis blandit maximus. Morbi nec mauris volutpat, feugiat magna ac, auctor felis. In sed sapien sed enim dictum tristique nec eu nunc. Vestibulum ac tincidunt nulla, non tincidunt urna. Nulla eu massa sed neque ultrices vestibulum. Ut quis feugiat risus, quis vehicula nisl. Proin vitae erat et justo elementum cursus a ut enim. Nam lobortis lorem urna, et auctor dui lobortis in. Curabitur aliquam sodales ante. In odio lorem, lobortis a metus in, lobortis vehicula tellus. Aliquam auctor, libero ac molestie mollis, dui felis porttitor neque, vel scelerisque sem mi vel nunc. Donec ultrices nulla non tristique imperdiet. Vivamus efficitur consequat dapibus.

Integer faucibus laoreet lacus pretium convallis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Cras auctor nulla quis risus ultricies condimentum vitae nec purus. Phasellus dui tortor, placerat volutpat faucibus sed, fermentum sed lacus. Nulla scelerisque neque tincidunt elementum maximus. Cras blandit dapibus rhoncus. Curabitur accumsan nisi nec arcu posuere lobortis. Donec sodales mauris in odio auctor, malesuada mollis sapien hendrerit. Mauris erat nisl, euismod at tempor sit amet, egestas quis leo. Phasellus at ligula viverra, dignissim erat eu, mattis nibh. Proin mollis sed nisl at iaculis. Nam id nunc justo.

Fusce leo lorem, feugiat ut tristique a, placerat placerat velit. Integer fringilla felis a lorem tincidunt, at condimentum massa hendrerit. Aliquam egestas magna semper scelerisque auctor. Maecenas dolor nibh, dictum non feugiat id, hendrerit a massa. Curabitur dignissim placerat massa, vel sollicitudin mauris tincidunt nec. Aliquam convallis et felis aliquet varius. Nam id mauris lobortis, pharetra turpis ac, posuere urna. Vestibulum id viverra mi. Curabitur ullamcorper, sem sed rhoncus pulvinar, sapien leo vehicula sapien, quis semper lorem nisl ut massa. Vestibulum quis enim sapien. Maecenas risus odio, lobortis vel eros at, tempus blandit est. Fusce commodo eu diam eget imperdiet. Curabitur lacus justo, fringilla id scelerisque id, consequat vitae leo. Proin fermentum nisi finibus leo finibus lobortis non vitae libero. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.

Nam nisl odio, iaculis id neque mattis, ullamcorper ullamcorper massa. Mauris blandit nisi id odio tempus, sit amet viverra purus sagittis. Cras consectetur, ipsum eu auctor lobortis, dolor mauris volutpat nisi, at ullamcorper orci ex nec ipsum. Maecenas ac suscipit nunc. Duis lacinia leo id leo luctus pharetra. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum vitae quam rutrum mi vestibulum laoreet iaculis vel purus. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Proin ultrices, massa eget tempor varius, libero urna volutpat eros, id volutpat magna ligula aliquam diam.

Aenean malesuada erat sit amet purus accumsan, vel faucibus tortor ullamcorper. Etiam et augue sed est accumsan congue. Pellentesque congue nunc eu diam porttitor gravida. Curabitur pretium consectetur augue, lacinia lacinia nibh. Ut lobortis viverra dolor eu aliquet. Nam accumsan blandit leo sed placerat. Mauris et elit malesuada, placerat metus in, facilisis lectus. Phasellus eget nisi turpis. Pellentesque nec metus vitae erat faucibus dapibus eget eget turpis. Mauris sed metus neque. In ac massa ex. Praesent rhoncus risus et suscipit gravida. Nulla facilisi. Aliquam molestie magna ac felis laoreet accumsan.
</section>
              
            
!

CSS

              
                *{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat',sans-serif;
}

body{
  background: grey;
}
nav{
  padding: 5px 40px;
}
nav.sticky{
    padding: 5px 40px;
    background: #fff;
}
nav.sticky .logo,
nav.sticky ul li a{
    color: #000;
}

nav ul{
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
nav ul li{
  padding: 15px 0;
  cursor: pointer;
}
nav ul li.items{
  position: relative;
  width: auto;
  margin: 0 16px;
  text-align: center;
  order: 3;
}
nav ul li.items:after{
  position: absolute;
  content: '';
  left: 0;
  bottom: 5px;
  height: 2px;
  width: 100%;
  background: #33ffff;
  opacity: 0;
  transition: all 0.2s linear;
}
nav ul li.items:hover:after{
  opacity: 1;
  bottom: 8px;
}
nav ul li.logo{
  flex: 1;
  color: white;
  font-size: 23px;
  font-weight: 600;
  cursor: default;
  user-select: none;
}
nav ul li a{
  color: white;
  font-size: 18px;
  text-decoration: none;
  transition: .4s;
}
nav ul li:hover a{
  color: cyan;
}
nav ul li i{
  font-size: 23px;
}
nav ul li.btn{
  display: none;
}
nav ul li.btn.hide i:before{
  content: '\f00d';
}
@media all and (max-width: 900px){
  nav{
    padding: 5px 30px;
    background: #fff; 
  }
  nav ul li.items{
    width: 100%;
    display: none;
  }
  nav ul li.items.show{
    display: block;
  }
  nav ul li.btn{
    display: block;
  }
  nav ul li.items:hover{
    border-radius: 5px;
    box-shadow: inset 0 0 5px #33ffff,
                inset 0 0 10px #66ffff;
  }
  nav ul li.items:hover:after{
    opacity: 0;
  }
}

              
            
!

JS

              
                
      $(document).ready(function(){
        $('.btn').click(function(){
          $('.items').toggleClass("show");
          $('ul li').toggleClass("hide");
        });
      });

window.addEventListener("scroll",function(){
    var nav = document.querySelector("nav");
    nav.classList.toggle("sticky",window.scrollY > 0)
})
              
            
!
999px

Console