Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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.

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.

            
              <link href='https://fonts.googleapis.com/css?family=Esteban' rel='stylesheet' type='text/css'>

<div id="top_nav">
		<ul>
			<li><a href="#">Nav button 1</a></li>
			<li><a href="#">Nav button 2</a></li>
			<li><a href="#">Nav button 3</a></li>
			<li><a href="#">Nav button 4</a></li>
			<li><a href="#">Nav button 5</a></li>
			<li><a href="#">Nav button 6</a></li>
			<li><a href="#">Nav button 7</a></li>
			<li><a href="#">Nav button 8</a></li>
		</ul>
	</div>
	<div id="panel">
		<ul class="menu">
			<li>
				<img src="https://s8.postimg.org/chqdmmoo5/all_posts.png">
				<span class="title">All posts</span> 
				<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse interdum dictum scelerisque. Morbi eu euismod lorem.</div>
			</li>
			<li>
				<img src="https://s28.postimg.org/ma9mhuywt/new_post.png">
				<span class="title">New post</span> 
				<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse interdum dictum scelerisque. Morbi eu euismod lorem.</div>
			</li>
			<li>
				<img src="https://s16.postimg.org/a3bn204w5/messages.png">
				<span class="title">Messages</span> 
				<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse interdum dictum scelerisque. Morbi eu euismod lorem.</div>
			</li>
			<li>
				<img src="https://s30.postimg.org/wfshvw6s1/events.png">
				<span class="title">Events</span> 
				<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse interdum dictum scelerisque. Morbi eu euismod lorem.</div>
			</li>
			<li>
				<img src="https://s17.postimg.org/ysoppmqrj/gifts.png">
				<span class="title">Gifts</span> 
				<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse interdum dictum scelerisque. Morbi eu euismod lorem.</div>
			</li>
			<li>
				<img src="https://s17.postimg.org/ownmpzkzj/groups.png">
				<span class="title">Groups</span> 
				<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse interdum dictum scelerisque. Morbi eu euismod lorem.</div>
			</li>
			<li>
				<img src="https://s30.postimg.org/dddpmpl5d/music.png">
				<span class="title">Music</span>
				<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse interdum dictum scelerisque. Morbi eu euismod lorem.</div>
			</li>
			<li>
				<img src="https://s15.postimg.org/s4wkhqnaz/favorites.png">
				<span class="title">Favorites</span>
				<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse interdum dictum scelerisque. Morbi eu euismod lorem.</div>
			</li>
			<li>
				<img src="https://s22.postimg.org/k7m4p6zht/options.png">
				<span class="title">Options</span>
				<div class="content">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse interdum dictum scelerisque. Morbi eu euismod lorem.</div>
			</li>     
		</ul>
	</div>
            
          
!
            
              .menu{
  width: 620px;
  margin: 100px auto; padding: 15px;	  
  list-style: none;
  counter-reset: li;
  background: #eee;
  -moz-box-shadow: 0 1px 2px rgba(0,0,0,.1) inset;
  -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.1) inset;
  box-shadow: 0 1px 2px rgba(0,0,0,.1) inset;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
}

.menu:after {
  clear: both;
}

.menu {
  zoom:1;
}

/* -------------------------------- */        

.menu li {
  position: relative;
  float: left;
  cursor: pointer;
  height: 120px; width: 200px;
  margin: 10px 0 0 10px;
  color: #fff;
} 

.menu li:hover, .menu li:focus{
  background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,.2)), to(rgba(255,255,255,0)));
  background-image: -webkit-linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0));
  background-image: -moz-linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0));
  background-image: -ms-linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0));
  background-image: -o-linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0));
  background-image: linear-gradient(top, rgba(255,255,255,.2), rgba(255,255,255,0));
}

.menu .cover{
  z-index: 2;
}

.menu .cover:focus{
  outline: 0;
}     

.menu li:nth-child(1),
.menu li:nth-child(2),
.menu li:nth-child(3){
  margin-top: 0;
}

.menu li:nth-child(1),
.menu li:nth-child(4),
.menu li:nth-child(7){
  margin-left: 0;      
}

/* -------------------------------- */       

.menu li:nth-child(1),
.menu li:nth-child(1) .content,
.menu li:nth-child(1) .close{
  background-color: #2c618f;
}         

.menu li:nth-child(2),
.menu li:nth-child(2) .content,
.menu li:nth-child(2) .close{
  background-color: #91ab31;   
}   

.menu li:nth-child(3),
.menu li:nth-child(3) .content,
.menu li:nth-child(3) .close{
  background-color: #714a28;   
}

.menu li:nth-child(4),
.menu li:nth-child(4) .content,
.menu li:nth-child(4) .close{
  background-color: #e58600;      
}

.menu li:nth-child(5),
.menu li:nth-child(5) .content,
.menu li:nth-child(5) .close{
  background-color: #c33a00;
}

.menu li:nth-child(6),
.menu li:nth-child(6) .content,
.menu li:nth-child(6) .close{
  background-color: #7f5dac;
}

.menu li:nth-child(7),
.menu li:nth-child(7) .content,
.menu li:nth-child(7) .close{
  background-color: #5672b7;     
}

.menu li:nth-child(8),
.menu li:nth-child(8) .content,
.menu li:nth-child(8) .close{
  background-color: #69003f;
}

.menu li:nth-child(9),
.menu li:nth-child(9) .content,
.menu li:nth-child(9) .close{
  background-color: #393043;
}

/* -------------------------------- */

.menu .content{
  opacity: 0; display: none\9;
  overflow: hidden;
  font: 12px Arial, Helvetica;
  position: absolute;
  height: 120px; width: 200px; /* Ideally: height: 100%; width: 100%; but works at it should just in FF */
  -webkit-transition: all .3s ease-out;
  -moz-transition: all .3s ease-out;
  -ms-transition: all .3s ease-out; 
  -o-transition: all .3s ease-out;  
  transition: all .3s ease-out;      
}  

.menu .expanded{
  opacity: .95; display: block\9;
  overflow: visible;
  padding: 40px;
  height: 300px; width: 540px; /* Cover the entire area */
}

/* -------------------------------- */    

.menu .title{
  position: absolute;
  height: 100%; width: 100%;
  text-align: center;
  font: italic bold 1em/120px 'trebuchet MS', Arial, helvetica;
  opacity: 0;
  -moz-transition: opacity 0.5s;
  -webkit-transition: opacity 0.5s;
  transition: opacity 0.5s;
}

.menu li:hover .title{
  opacity: .85;
}    

/* -------------------------------- */

.menu .close {
  display: none;
  border: 5px solid #fff;
  color: #fff;
  cursor: pointer;
  height: 40px; width: 40px;
  font: bold 20px/40px arial, helvetica;
  position: absolute;
  text-align: center;
  top: -20px; right: -20px;
  -moz-border-radius: 40px;
  -webkit-border-radius: 40px;
  border-radius: 40px;      
}

.menu .cover .close{
  display: block;
}




/*************************************/




body {
  width: 100%;
	margin: 0;
	float: left;
}

#top_nav {
	width: 100%;
	margin-bottom: 20px;
	background: #000;
	float: left;
}

#top_nav ul {
	width: 100%;
	margin: 0;
	padding: 0;
	float: left;
}

#top_nav li {
	width: 12.5%;
	list-style: none;
	float: left;
}

#top_nav li a {
	display: block;
	width: 100%;
	height: 45px;
	color: #dad7d7;
	font-family: 'Esteban', serif;
	line-height: 45px;
	text-align: center;
	text-decoration: none;
}

#top_nav li a:hover {
	color: #fff;
	background: #333;
}

#panel {
	width: 75%;
	margin: 0 auto;
}

.menu {
	width: 98%;
	height: 98%;
	margin: 0 auto;
	padding: 1%;
	position: relative;
	float: left;
}

.menu li {
	width: 32.5%;
	height: 250px;
	position: static;
}

.menu li img {
	display: block;
	width: 20%;
	margin: 85px auto 0;
	-moz-transition: margin 0.5s;
	-webkit-transition: margin 0.5s;
	transition: margin 0.5s;
}

.menu li:hover img {
	margin: 63px auto 0;
}

.menu li .title {
	display: block;
	width: 100%;
	height: auto;
	font-family: 'Esteban', serif;
	font-size: 25px;
	font-style: normal;
	font-weight: normal;
	line-height: 60px;
	position: static;
}

.menu li .content {
	width: 0px;
	height: 0px;
  position: absolute;
  top: 0;
  left: 0; 
}

.menu li .content.expanded {
	width: 94%;
	height: 93.75%;
	margin: 1%;
	padding: 2%;
	position: absolute;
	top: 0;
	left: 0;
}
            
          
!
            
              (function(){
	  
		// Append a close trigger for each block
		$('.menu .content').append('<span class="close">x</span>');		
		// Show window
		function showContent(elem){
			hideContent();
			elem.find('.content').addClass('expanded');
			elem.addClass('cover');	
		}
		// Reset all
		function hideContent(){
			$('.menu .content').removeClass('expanded');
			$('.menu li').removeClass('cover');		
		}
		
		// When a li is clicked, show its content window and position it above all
		$('.menu li').click(function() {
			showContent($(this));
		});		
		// When tabbing, show its content window using ENTER key
		$('.menu li').keypress(function(e) {
			if (e.keyCode == 13) { 
				showContent($(this));
			}
		});

		// When right upper close element is clicked  - reset all
		$('.menu .close').click(function(e) {
			e.stopPropagation();
			hideContent();
		});		
		// Also, when ESC key is pressed - reset all
		$(document).keyup(function(e) {
			if (e.keyCode == 27) { 
			  hideContent();
			}
		});
		
	  })();
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console