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 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

              
                <!--Pattern HTML-->
  <div id="pattern" class="pattern">
  	<!--Begin Pattern HTML-->
		<ul class="navigation" role="navigation">
			<li><a href="#">Home</a></li>
			<li><a href="#">About</a></li>
			<li><a href="#">Products</a></li>
			<li><a href="#">Services</a></li>
			<li><a href="#">Contact</a></li>
		</ul>
	</div>
	<!--End Pattern HTML-->

	
	<div class="container">	
		<section class="pattern-description">
			<h1>Stacked Top Links</h1>
			<p>A navigation that vertically stacks navigation items on top of each other for small screens, and becomes a horizontal list when screen space becomes available.</p>
			<h3>Pros</h3>
			<ul>
			<li><strong>Easy to implement</strong>- you can implement your large-screen site almost as-is.</li>								<li><strong>More touch-friendly than the top links pattern</strong> - Where links across the top can lead to unwanted proximity clicks, stacking the links provides a larger hit state</li>
			</ul>
			<h3>Cons</h3>
			<ul>
			<li><strong>Height issues</strong>- <a href="http://andmag.se/2012/01/height-matters/">Height matters in mobile</a>. As <a href="http://www.abookapart.com/products/mobile-first">Luke's book</a> explains, content-first, nav-second is preferred for mobile web experiences. You want to get the users to the meat-and-potatoes content as quickly as possible. That means getting the navigation out of user's way so they can focus on the core information on the page. It can also be confusing when all the core content is cut off</li>
			</ul>
		</section>
		<footer role="contentinfo">   
			<div>
				<nav id="menu">
					<a href="https://bradfrost.github.com/this-is-responsive/patterns.html">&larr;More Responsive Patterns</a>
				</nav>
			</div>
		</footer>
	</div>
              
            
!

CSS

              
                .navigation li a {
  		display: block;
			border-bottom: 1px solid #000;
			padding: 1em;
		}
		
		@media all and (min-width: 30em) {
			.navigation li {
				display: inline-block;
				margin: 0 0.5em;
			}
			.navigation li a {
				padding: 1em 0.5em;
				border: 0;
			}
		}
              
            
!

JS

              
                
              
            
!
999px

Console