cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <header>
  <nav class="links" role="site-nav">
    <ul id="menu-secondary-nav" class="secondary-nav">
      <li><a href="#">About This</a></li>
      <li><a href="#">Contacts</a></li>
    </ul>				
  </nav>
  
  <nav class="social" role="social">
    <a href="#"><i class="genericon genericon-pinterest-alt"></i></a>
    <a href="#"><i class="genericon genericon-twitter"></i></a>
    <a href="#"><i class="genericon genericon-facebook-alt"></i></a>
    <a href="#"><i class="genericon genericon-instagram"></i></a>
    <a href="#"><i class="genericon genericon-feed"></i></a>
  </nav>
  
  <nav>
    <form role="search" method="get" class="search-form" action="/">
      <label>
        <input type="search" class="search-field" placeholder="What are yee looking for?" name="search" title="Search for:" />
      </label>
    </form>				
  </nav>
  
  <div class="sub-head">
    <h1>Those color boxes are pretend social icons</h1>
  </div>
  
  <nav class="mainnav">
    <ul class="nav-list">
      <li><a href="#">Love It</a></li>
      <li><a href="#">Solid Bro</a></li>
      <li><a href="#">Kitty Kats</a></li>
      <li><a href="#">Travel There</a></li>
      <li><a href="#">Blogged Down</a></li>
      <li><a href="#">Book Nerd</a></li>
      <li><a href="#">Etc</a></li>
    </ul>				
  </nav>
</header>
            
          
!
            
              $red: #f1605d;
$purple: #44445c;
$aqua: #42a5bd;
$maroon: #a14e56;
$pink: #f26a74;
$blue: rgba(#22DFF8, 0.25);

$ovo: 'Ovo', serif;
$grandHotel: 'Grand Hotel', cursive;
$montserrat: 'Montserrat', sans-serif;

@mixin vendor-prefix ($name, $argument) {
    #{$name}: $argument;
    -webkit-#{$name}: $argument;
    -ms-#{$name}: $argument;
    -moz-#{$name}: $argument;
    -o-#{$name}: $argument;
}

body {
  background: $blue;
	  margin: 0 auto;
	  width: 100%;
}

header {
	  display: block;
	  margin: 2em auto;
	  overflow: hidden;
	  position: relative;
	  text-align: center;
  
  .nav-check {
    display: none;  
  }
  
  .links {
    
    li {
      padding: 0;
      width: 50%;
    }
  }
  
  .secondary-nav {
    
    li {
      
      &:first-of-type {
        text-align: right;
        width: 54%;
      }
      
      &:nth-of-type(2) {
        text-align: left; 
        width: 46%;
      }
    }
  }
}

nav {
	  float: none;
	  padding: 1.5em;

  	.secondary-nav {
  		  list-style: none;
  		  margin: 0;
    		padding: 0;

		    a {
    			  color: $red;
    			  font-family: $ovo;
    			  font-size: .875em;
      			line-height: 1.75em;
      			margin: 0;		
      			position: relative;
      transition: .3s all ease;

			      &:hover {
				        color: $aqua;
				        @include vendor-prefix (transition, .3s all ease);

		  		      &:after {
					          color: $red;
				        }
			      }
		    }

		    li {
  			    float: left;
  			    margin: 0;
    			  padding: 0;

  			    &:first-of-type {

    				    a {
          margin-right: 1rem;
      					    padding-right: 1rem;

        					  &:after {
          						  content: '|';
            						position: absolute;
            						right: 0;
					          } 
    				    }
			      }
    }
	  }

	  &.social {
		    margin: 0;
	  }

	  i {
    		line-height: 1.5em;
    		padding: .5rem 1rem;
    		margin-right: 1rem;
    		@include vendor-prefix (transition, .3s all ease);

    &.genericon-pinterest-alt {
      			background: $red;

      			&:hover {
        				color: $blue;
      			}
		    }

    		&.genericon-twitter {
      			background: #65cdef;

    			  &:hover {
      				  color: #65cdef;
			      }
		    }

		    &.genericon-facebook-alt {
			      background: #507cbe;

    			  &:hover {
      				  color: #507cbe;
    			  }
		    }

  		  &.genericon-instagram {
      			background: #5f6364;

  			    &:hover {
      				  color: #5f6364;
  			    }
		    }

  		  &.genericon-feed {
      			background: #f7931e;
    			  margin-right: 0;

      			&:hover {
        				color: #f7931e;
			      }
		    }

		    &:hover {
			      background: #faf0f0;
      			@include vendor-prefix (transition, .3s all ease);
		    }
	  }

  	form {
  		  display: block;
    		margin: 0 auto;
  		  width: 14.3em;
	  }
}

.search-field {
  	background-image: url('data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%0D%0A%3C%21--%20Generator%3A%20Adobe%20Illustrator%2017.0.0%2C%20SVG%20Export%20Plug-In%20.%20SVG%20Version%3A%206.00%20Build%200%29%20%20--%3E%0D%0A%3C%21DOCTYPE%20svg%20PUBLIC%20%22-//W3C//DTD%20SVG%201.1//EN%22%20%22http%3A//www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd%22%3E%0D%0A%3Csvg%20version%3D%221.1%22%20id%3D%22icons%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20x%3D%220px%22%20y%3D%220px%22%0D%0A%09%20width%3D%2218px%22%20height%3D%2217.8px%22%20viewBox%3D%220%200%2018%2017.8%22%20style%3D%22enable-background%3Anew%200%200%2018%2017.8%3B%22%20xml%3Aspace%3D%22preserve%22%3E%0D%0A%3Cstyle%20type%3D%22text/css%22%3E%0D%0A%09.st0%7Bfill%3A%239F9E9F%3B%7D%0D%0A%3C/style%3E%0D%0A%3Cpath%20class%3D%22st0%22%20d%3D%22M17.4%2C15.1l-3.8-3.8c0.7-1.1%2C1.2-2.5%2C1.2-3.9c0-4-3.3-7.3-7.3-7.3c-4%2C0-7.3%2C3.3-7.3%2C7.3c0%2C4%2C3.3%2C7.3%2C7.3%2C7.3%0D%0A%09c1.4%2C0%2C2.8-0.4%2C3.9-1.2l3.8%2C3.8c0.3%2C0.3%2C0.7%2C0.5%2C1.1%2C0.5c0.4%2C0%2C0.8-0.2%2C1.1-0.5C18%2C16.7%2C18%2C15.7%2C17.4%2C15.1z%20M2.2%2C7.4%0D%0A%09c0-2.9%2C2.3-5.2%2C5.2-5.2c2.9%2C0%2C5.2%2C2.3%2C5.2%2C5.2c0%2C2.9-2.3%2C5.2-5.2%2C5.2C4.6%2C12.6%2C2.2%2C10.2%2C2.2%2C7.4z%22/%3E%0D%0A%3C/svg%3E%0D%0A');
  	background-position: 98% 45%;
  	background-repeat: no-repeat;
  border: none;
  	font-family: $grandHotel;
  	font-weight: 400;
  margin: 0 0 1rem;
  	padding: 6px 10px;
  	position: relative;
  width: 100%;
  	@include vendor-prefix (transition, .3s all ease-out);

	  &:focus {
    		background-position: 2% 45%;
    		padding: 6px 10px 6px 25px;
    		@include vendor-prefix (transition, .3s all ease-out);
	  }
}

.sub-head {
  	padding: 1em;
  	text-align: center;

  	h1 {
    		color: #9e99a7;
    		font-size: .75em;
  		  letter-spacing: 1px;
    		margin: 0;
    		text-transform: uppercase;
	  }
}

.mainnav {
  	@extend .sub-head;
  	box-sizing: content-box;
  	padding: 1.625em 0;
	
  	ul {
    		margin: 0;
    padding: 0;
	
    		li {
      			list-style: none;
			      display: block;
      			position: relative;
		    }
	  }

	  a {
    		display: block;
    		color: $purple;
		    font-family: $montserrat;
		    font-size: 1em;
		    line-height: 2em;
  		  padding: 0 1em;
		    position: relative;
  		  text-transform: uppercase;
		    @include vendor-prefix (transition, .3s all ease);

		  &:hover {
			    color: $aqua;
    			@include vendor-prefix (transition, .3s all ease);

			      &:before {
				        background: $aqua;
				        @include vendor-prefix (transition, 0.3s all ease);
			      }
    }
		  }
}

/*=========================================
  Navicon Slider
=========================================*/

.both-nav {
  
  	.links {
    		background: rgba(255,255,255,0.9);
    		border: none;
    		left: -120%;
    		padding: 30px 0 0;
    		position: fixed;
    		top: 0px;
    		width: 100%;
    		@include vendor-prefix (transition, .3s all ease);

    		.secondary-nav {

			      li {
        				text-align: center;
		        	width: 100%;
        
        &:nth-of-type(2) {
          padding-bottom: 12px; 
        }

		    	    a {
      		    		color: $purple;
		          		display: block;
					          font-family: $montserrat;
					          font-size: .875rem;
					          line-height: normal;
					          margin: 0;
          					padding: 12px 0;
          					text-transform: uppercase;

          					&:after {
            						content: '';
          					}
		    	    }
			      }
		    }
	  }
  
  	.mainnav {
    	border: none;
      
    ul {
      padding: 0;
    }

    	li {
      margin: 0;
      padding: 0;
      text-align: center;
      width: 100%;
        
    		  a {
        			color: $purple;
				        font-family: $montserrat;
				        font-size: .875rem;
				        line-height: normal;
        				padding: 12px 0;
      		}
    	}
  	}
  
	  .nav-check {
	    cursor: pointer;
	    display: block;
	    left: 5px;
	    height: 30px;
	    position: absolute;
	    top: 5px;
	    width: 30px;
	    z-index: 2;
	    
	    &:before {
	      	background: #bff8ff;
	      	color: $purple;
			      content: '|||';
      			font-size: 1.5rem;
      			height: 30px;
      			line-height: 30px;
      			left: 0;
      position: absolute;
      			top: 0;
      			width: 30px;
      			z-index: 1;
      			@include vendor-prefix (transform, rotate(90deg));
      			@include vendor-prefix (transition, 0.3s all ease);
	    }

	    &:hover {

	    	  &:before {
        				color: $aqua;
        				@include vendor-prefix (transition, 0.3s all ease);
			      }
		    }
    
	    &:checked {

	      	&:before {
	      		  background: #fff;
	    		    color: $aqua;
	    	  }    
	    
	      	&~ .links { 
	        	left: 0;
	        	right: 0;
	        	z-index: 1;
	        	@include vendor-prefix (transition, 0.3s all ease);
	      	}
	    }
	  }
}
            
          
!
            
              function navChange() {
  if ( $(window).width() < 768 ) {
  	
    	if ( !$( 'header' ).hasClass( 'both-nav' ) ) {
	      $( '.mainnav' ).appendTo( '.links' );
	      $( 'header' ).addClass( 'both-nav' );
	      $( 'header' ).prepend( '<input class="nav-check" type="checkbox">' );
    }

  } else {
    
    $( '.mainnav' ).appendTo( 'header' );

    if ( $( 'header' ).hasClass( 'both-nav' ) ) {
      $( 'header' ).removeClass( 'both-nav' ); 
    }
  }
}

navChange();

$(window).resize( navChange );
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console