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

            
              <nav>
	<ul>
		<li><a href="#0">Home</a></li>
		<li><a href="#0">About</a></li>
		<li>
			<a href="#0">Clients</a>
			<ul>
				<li>
					<a href="#0">Burger King</a>
					<ul>
						<li><a href="#0">Project 1</a></li>
						<li><a href="#0">Project 2</a></li>
						<li><a href="#0">Project 3</a></li>
					</ul>
				</li>
				<li>
					<a href="#0">Southwest Airlines</a>
					<ul>
						<li><a href="#0">Project 1</a></li>
						<li><a href="#0">Project 2</a></li>
						<li><a href="#0">Project 3</a></li>
					</ul>
				</li>
				<li>
					<a href="#0">Levi Strauss</a>
					<ul>
						<li><a href="#0">Project 1</a></li>
						<li><a href="#0">Project 2</a></li>
						<li><a href="#0">Project 3</a></li>
					</ul>
				</li>
			</ul>
		</li>
		<li>
			<a href="#0">Services</a>
			<ul>
				<li>
					<a href="#0">Print Design</a>
					<ul>
						<li><a href="#0">Subservice 1</a></li>
						<li><a href="#0">Subservice 2</a></li>
						<li><a href="#0">Subservice 3</a></li>
					</ul>
				</li>
				<li>
					<a href="#0">Web Design</a>
					<ul>
						<li><a href="#0">Subservice 1</a></li>
						<li><a href="#0">Subservice 2</a></li>
						<li><a href="#0">Subservice 3</a></li>
					</ul>
				</li>
				<li>
					<a href="#0">Mobile App Development</a>
					<ul>
						<li><a href="#0">Subservice 1</a></li>
						<li><a href="#0">Subservice 2</a></li>
						<li><a href="#0">Subservice 3</a></li>
					</ul>
				</li>
			</ul>
		</li>
		<li><a href="#0">Contact</a></li>
	</ul>
</nav>

<div id="content">
  <h1>Sidebar Navigation</h1>
  <h2>A Codepen Challenge</h2>

  <p>This Pen was made for the Navigation Challenge on Codepen in August 2019.</p>
  <p>Hover on the Burger-Menu to open the sidebar.</p>
  <p>Feel free to use this small example of a Sidebar Navigation in your project.</p>
</div>
            
          
!

CSS

            
              /* Sidebar */

	/* Main-Wrapper */
	nav {
		position: fixed;
		width: 150px;
		left: -150px;
		top: 0;
		bottom: 0;
		background-color: rgba( 0, 0, 0, .9 );
		padding: 15px 0;
		transition: left 1s ease-in .5s;
	}
	nav:after {
		content: "\f0c9";
		font-family: "FontAwesome";
		font-weight: 400;
		font-style: normal;
		text-decoration: inherit;
		color: #ffffff;
		position: absolute;
		left: 100%;
		top: 0;
		padding: 15px;
		background-color: rgba( 0, 0, 0, .9 );
		border-bottom-right-radius: 5px;
		cursor: pointer;
	}
	nav:hover {
		left: 0;
		transition: left 1s ease-in 0s;
	}
	nav:hover:after {
		content: "\f00d";
	}

	/* Global Styles */
	nav ul a {
		color: #ffffff;
		text-decoration: none;
		padding-left: 25px;
		display: block;
	}
	nav ul a:after {
		content: "\f054";
		font-family: "FontAwesome";
		display: block;
		position: absolute;
		left: 15px;
		top: 13px;
		font-size: 12px;
	}
	nav ul {
		list-style-type: none;
		padding: 0;
		margin: 0;
	}
	nav ul li {
		position: relative;
	}
	nav ul li a {
		padding: 10px 5px;
		padding-left: 30px;
	}
	nav ul li:hover {
		background-color: rgba( 0, 150, 255, 1 );
	}

	/* First-Level Navigation */
	nav > ul {
		margin-top: 32px;
	}

	/* Multi-Level Navigation */
	nav ul li > ul {
		position: absolute;
		background-color: rgba( 0, 0, 0, .9 );
		width: 100%;
		top: 1999px;
		left: 100%;
		transition: top .5s;
	}
	nav ul li > ul li {
		min-width: 120px;
	}
	nav ul li:hover > ul,
	nav ul li > ul:hover {
		top: 0%;
	}
  
  /* Alternative Style */
  /* Looks good, but a bit unhandy */
  /*
    nav ul li > ul {
        position: unset;
        background-color: transparent;
        margin-left: 10px;
        max-height: 0;
        transition: max-height .5s;
        overflow: hidden;
    }
    nav ul li:hover > ul {
        max-height: 999px;
        overflow: visible;
    }

    nav ul li {
        background-color: rgba( 0, 0, 0, .4 );
    }
    nav ul li:hover {
        background-color: rgba( 0, 150, 255, .4 );
    }
  /**/

/* Other CSS */
body {
	font-family: Arial, sans-serif;
}
#content {
	text-align: center;
	margin: 100px 0;
}
h1 {
	margin-bottom: 10px;
}
h2 {
	margin-top: 10px;
}
p {
	margin: 0 0 10px 0;
}
            
          
!

JS

            
              
            
          
!
999px

Console