123

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.

            
              <html>
<head>
	<title>Header</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0">
	<link rel="stylesheet" href="header.css">
</head>
<body>
	<div class="mobile-display" >
		<h2 class="site-title">
			<a href="#">
				<img src="http://i.imgsafe.org/cb0d96e.png" alt="smashtheshell" >
			</a>
		</h2>
	</div>
	<header>
		<nav>
			<a href="#" class="toggle-menu">&#9776;</a>
			<ul class="nav-list nav-open" id="nav">
				<li><a href="#">Contact</a></li>
				<li class="has-submenu"><a href="#">Portfolio</a>
					<ul>
						<li><a href="#">Web Designing</a></li>
						<li><a href="#">Web Development</a></li>
						<li><a href="#">UI Designing</a></li>
						<li><a href="#">Back End Development</a></li>
						<li><a href="#">Front End Development</a></li>
					</ul>
				</li>
				<li class="has-logo"><a href="#">
					<h2 class="site-title">
						<img src="http://i.imgsafe.org/cb0d96e.png" alt="smashtheshell">
					</h2>
				</a></li>
				<li class="has-submenu"><a href="#">Services</a>
					<ul>
						<li><a href="#">Web Development</a></li>
						<li><a href="#">Web Design</a></li>
						<li><a href="#">UI Designing</a></li>
						<li><a href="#">Back End Development</a></li>
						<li><a href="#">Front End Development</a></li>
					</ul>
				</li>
				<li><a href="#">About</a></li>
			</ul>
		</nav>
	</header>	
	

<main>
	<section>
		<h1>Post 1 : Creating Header with Logo in Middle of Navigation Menu </h1>
		<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic beatae qui, est perspiciatis ducimus delectus pariatur nisi enim similique earum tempora aut, unde, quod. Iusto quod mollitia, in aspernatur non ratione voluptas vero sit veniam sunt quibusdam doloremque et harum soluta hic placeat ab excepturi nesciunt animi rerum enim officiis blanditiis porro itaque. Doloremque, voluptates consectetur quis soluta assumenda, temporibus sequi aliquid. Porro delectus accusantium dicta officiis cupiditate reiciendis praesentium quam explicabo animi necessitatibus blanditiis maxime molestiae, ullam aliquam ea, inventore temporibus nihil eum tempore minus architecto rerum aut. Nulla eos laboriosam, minus earum alias, repellat tempore facilis iusto quibusdam deleniti assumenda magnam dolore doloribus saepe maiores. Expedita enim ea, maiores beatae odit, eaque officia ut vitae! Nihil nisi non ullam. Officiis nihil, repellendus dolorem reiciendis eius enim aperiam qui omnis, rerum voluptatum itaque fuga dignissimos nobis dolor explicabo perspiciatis necessitatibus, asperiores? Eveniet doloribus itaque optio perspiciatis iure, qui minima libero dicta suscipit ducimus, id rerum consequuntur autem reprehenderit corporis! Beatae obcaecati aut, impedit aliquid provident harum aspernatur, pariatur ea ipsa explicabo nulla earum dicta dolore nisi, molestiae optio modi. Totam beatae assumenda iusto, eveniet consectetur consequuntur repudiandae esse eos maxime, eligendi, tenetur incidunt odit nemo ducimus quidem eaque repellat.</p>
	</section>
</main>
<footer>&copy; 2015 | Smashtheshell</footer>

</body>
</html>
            
          
!
            
              html,header, footer, body, nav, div, img, a,ul, li, h1, h2{
	margin: 0;
	padding: 0;
	text-decoration: none;
	list-style-type: none;
}
*{box-sizing: border-box;}
html{
	font-size: 14px;
}
body{
	width: 80%;
	margin:0 auto;
	color: #444;
	border: 1px solid #ccc;
	font-family: helvetica;
}
a:link, a:visited{
	color:#555;
	font-weight: 700;
	transition: .2s color ease-in-out;
}
a:hover, a:active{
	color: #888;
}

/*styling content*/
main{
	padding: 1.5rem;
	line-height: 2.6rem;
}
section>p{
	text-indent: 2.6rem;
}
footer{
    background: #00b4de; color: #fbfbfb;  text-align: center; padding: 2em 0;
}

/*styling the header part*/
.toggle-menu{
	display: none;
}
header{
	margin:2rem 0;
}
.site-title img{
	max-width: 100px;
	display: inline-block;
	vertical-align: middle;
	-webkit-filter: grayscale(90%);
	-moz-filter: grayscale(90%);
	filter: grayscale(90%);
}

.nav-list{
	display: flex;
	flex-flow: row;
	justify-content: space-between;
	align-items: center;
	white-space: nowrap;
}
.nav-list > li {
	position: relative;
}

.nav-list>li:not(.has-logo)>a{
	text-transform: uppercase;
	display: block;
	padding:1rem;
}

.nav-list ul{
	position: absolute;
	z-index: 1010;
	background-color: #fff;
	line-height: 2rem;
	left: -9999px;	
}

.nav-list ul a{
	font-weight: normal;
	display: block;
	padding: .5rem 1rem;	
}

.nav-list > li:hover a + ul{
	left: 0;
	top:100%;
}

.mobile-display{
	display: none;
}

@media only screen and (max-width: 58.75rem){
	html{
		font-size: 13px;
	}
	body{
		width: 80%;
	}
	.has-logo{
		display: none;
	}
	.mobile-display{
		display: block;
		margin:2rem auto;
		text-align: center
	}
}
@media only screen and (max-width: 33.68rem){
	.toggle-menu{
		display: block;
		max-width: -webkit-min-content;
		max-width: -moz-min-content;
		max-width: min-content;
		margin: 1rem auto;
		background-color: #393939;
		text-align: center;
		color: #fff !important;
		padding: 1rem;
		border-radius: .25em;

	}

	.toggle-menu:hover{background-color: #f92266;}

	.nav-list{
		display: block;
		width: 100%;
		position: static;
		line-height: 1rem;
		z-index: 1012;
		left: 0;
		top:0;
		background-color: #fff;
		
		max-height: 0;
		overflow: hidden;
	
	}

	.active{
		max-height: 100%;
		overflow: auto;
	}


	.nav-list  ul{
		position: static;
		text-indent: 2rem;
		z-index: 1013;
	}
}

            
          
!
            
              	$(document).ready(function(){

		var ulNav= "#nav", openNav = "active";	

		$('.toggle-menu').click(function(e){

				if($(ulNav).hasClass(openNav)){
					$(ulNav).removeClass(openNav);
				}else{
					$(ulNav).addClass(openNav);
				}
				e.preventDefault();
		})			
	})
            
          
!
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