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

              
                <!-- 
Homepage: no nav just buttons
https://envato.com/blog/css-snippets-responsive-menus/

https://codepen.io/gantit/pen/eCrbk

-->
<body>
<header>
    <div class="header_logo">
        <img src="https://s.imgur.com/images/logo-1200-630.jpg?2" width="500px">
    </div>
    <div>
    <nav class="clearfix">
      <ul class="clearfix topnav">
        <li><a href="#">news</a></il>
        <li><a href="#">weather</a></il>
        <li><a href="#">entertainment</a></il>
        <li><a href="#">sports</a></il>
        <li><a href="#">money</a></il>  
      </ul>
      <a href="#" id="pull">&#9776;</a>        
    </nav>
  </div>
</header>

  <div class="main">
     <p>Bacon ipsum dolor amet pork chop filet mignon jerky kielbasa. Tri-tip cow boudin shank flank, venison meatloaf capicola beef doner kielbasa rump. Pastrami meatloaf chicken, spare ribs cupim pork tri-tip. Pancetta beef ribs alcatra, filet mignon tri-tip tongue bacon. Kevin meatloaf tri-tip spare ribs sausage, frankfurter t-bone ham cow pastrami shankle. Chicken turducken corned beef bresaola porchetta kevin ribeye drumstick cupim kielbasa pork belly jerky biltong hamburger.</p> 
  </div>

<footer>
</footer>
</body>



              
            
!

CSS

              
                /* Clearfix */
.clearfix:before,
.clearfix:after {
    content: " ";
    display: table;
}
.clearfix:after {
    clear: both;
}
.clearfix {
    *zoom: 1;
}

html, body {
  margin:0;
  padding: 0;
  height: 100%;
  font-family: 'Roboto', arial, helvetica, sans-serif;
}
header {
  width:100%;
  background-color: #2a2a2a;
  position: relative;
  text-transform: uppercase; 
  margin-left: auto;
  margin-right: auto;
  width:100%; 
}

.header_logo {
  background-color: #2a2a2a;
}
.header_logo img {
  display:block;
  margin-left: auto;
  margin-right: auto;
  max-width:100%;
}

nav ul {
  list-style:none;
  margin:0;
  padding:0;
  line-height:3em;
  text-align: center; 
  background-color: #2a2a2a;
  border-bottom:2px solid #2a2a2a;
  font-size:20px;
  text-transform:uppercase;
}
nav li {
  display:inline;
  width: 100%;
  position: relative;
  
}
nav li a {
  text-decoration: none;
  padding: 0 40px;
  color: #FFF;
  display:inline;
  width: 100%;
  border-right:2px solid #2a2a2a;
  border-left:2px solid #2a2a2a;
  transition: all 500ms linear;
}
nav li a:hover {
  color:#85b525;
}

li.icon {
  display:none;
}

#pull {
  display:none;
  text-align:center;
  line-height:2em;
  text-decoration: none;
  color: #FFF;
  border-bottom:2px solid #2a2a2a;
  background-color: #2a2a2a;
}
#pull:hover{
  color: #d3d3d3;
}

.main {
  margin-left: auto;
  margin-right: auto;
  padding: 0 10px;
  max-width: 1200px;
}

/* ----------------------------------------------------- 
   ----------------------------------------------------- 
*/
@media screen and (max-width:800px) {
  nav {
    height: auto;
    align:center;
  }  
 
nav ul {
  width: 100%;
  display:none;
  height: auto;
  list-style: none;
  margin:0;
  padding:0;
  border-bottom:0px solid #2a2a2a;
}
nav li {
  display:block;
  margin:0;
  padding:0;
  position: relative;
/*   transition: all 900ms linear; */
}
  nav li a {
    padding: 0;
    display:block;
/*     border-bottom:2px solid #FFF; */
  }
  
nav a#pull {
		display: block;
		width: 100%;
		position: relative;
	}
	nav a#pull:after {
		content:"";
		display: inline-block;
		position: absolute;
	}
}
  
} /*media*/
              
            
!

JS

              
                // In Settings > Javascript > add jquery file
$(function() {
	var pull 		= $('#pull');
	menu 		= $('nav ul');
	menuHeight	= menu.height();
    $(pull).on('click', function(e) {
	    e.preventDefault();
	    menu.slideToggle();
    });
    $(window).resize(function(){
    		var w = $(window).width();
    		if(w > 320 && menu.is(':hidden')) {
    			menu.removeAttr('style');
    		}
  	});
});
              
            
!
999px

Console