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

              
                <ul id="nav">
		<li>
			<a href="#" title="Return home">Home</a>

		</li>
		<li>
			<a href="#" title="About the company">About</a>
			<ul>
				<li><a href="#">The product</a></li>
				<li><a href="#">Meet the team</a></li>
			</ul>

		</li>
		<li>
			<a href="#" title="The services we offer">Services</a>
			<ul>
				<li><a href="#">Sevice one</a></li>
				<li><a href="#">Sevice two</a></li>
				<li><a href="#">Sevice three</a></li>

				<li><a href="#">Sevice four</a></li>
			</ul>
		</li>
		<li>
			<a href="#" title="Our product range">Product</a>
			<ul>
				<li><a href="#">Small product (one)</a></li>

				<li><a href="#">Small product (two)</a></li>
				<li><a href="#">Small product (three)</a></li>
				<li><a href="#">Small product (four)</a></li>
				<li><a href="#">Big product (five)</a></li>
				<li><a href="#">Big product (six)</a></li>
				<li><a href="#">Big product (seven)</a></li>

				<li><a href="#">Big product (eight)</a></li>
				<li><a href="#">Enourmous product (nine)</a></li>
				<li><a href="#">Enourmous product (ten)</a></li>
				<li><a href="#">Enourmous product (eleven)</a></li>
			</ul>
		</li>
		<li>

			<a href="#" title="Get in touch with us">Contact</a>
			<ul>
				<li><a href="#">Out-of-hours</a></li>
				<li><a href="#">Directions</a></li>
			</ul>
		</li>
	</ul>
              
            
!

CSS

              
                * {
  margin:0;
  padding:0;
}

body{
	font-family:Arial,Verdana,sans-serif;
	font-size:0.75em;
	color:#333;
	margin:0 auto;
	padding:10px;
}



/* --------------------------------- */
#nav{
	list-style:none;
	font-weight:bold;
	margin-bottom:10px;
  text-align:center;
}
#nav li{
	margin-right:10px;
	position:relative;
   display:inline;
}
#nav a{
	padding:5px;
   display:inline-block;
	color:#fff;
	background:#333;
	text-decoration:none;
}
#nav a:hover{
	color:#fff;
	background:#6b0c36;
	text-decoration:underline;
}

/*--- DROPDOWN ---*/
#nav ul{
	background:#fff; /* Adding a background makes the dropdown work properly in IE7+. Make this as close to your page's background as possible (i.e. white page == white background). */
	background:rgba(255,255,255,0); /* But! Let's make the background fully transparent where we can, we don't actually want to see it if we can help it... */
	list-style:none;
	position:absolute;
  text-align:left;
	left:-9999px; /* Hide off-screen when not needed (this is more accessible than display:none;) */
}
#nav ul li{
	padding-top:1px; /* Introducing a padding between the li and the a give the illusion spaced items */
	float:none;
}
#nav ul a{
	white-space:nowrap; /* Stop text wrapping and creating multi-line dropdown items */
}
#nav li:hover ul{ /* Display the dropdown on hover */
	left:0; /* Bring back on-screen when needed */
}
#nav li:hover a{ /* These create persistent hover states, meaning the top-most link stays 'hovered' even when your cursor has moved down the list. */
	background:#6b0c36;
	text-decoration:underline;
}
#nav li:hover ul a{ /* The persistent hover state does however create a global style for links even before they're hovered. Here we undo these effects. */
	text-decoration:none;
}
#nav li:hover ul li a:hover{ /* Here we define the most explicit hover states--what happens when you hover each individual link. */
	background:#333;
}



              
            
!

JS

              
                
              
            
!
999px

Console