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

              
                <!DOCTYPE html>
<html lang="es">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Menu</title>
	<link rel="stylesheet" href="css/style.css">
	<link rel="stylesheet" href="icons/style.css">
</head>

<body>

<input type="checkbox" id="is_menu">
<div class="box-header-menu">
	<div class="header-menu">
		<label for="is_menu">
			<span class="icon-menu"></span>
			<span class="text-menu">Menu</span>
		</label>
	</div>

<nav class="nav">
	<div class="box-account">
		<div class="contain-photo-box">
			<div class="box-photo-img"> 
				<img src="images/user.jpg">
			</div>
		</div>
		<div class="box-name-user">
			<h4>User name</h4>
			<h5>email@email.com</h5>
		</div>
	</div>
	<ul class="menu">
		<li class="current-menu"><a href=""><span class="icon-home"></span>Home</a></li>
		
		<li><a href=""><span class="icon-info"></span>About Us</a></li>
		
		<li><a href=""><span class="icon-library_books"></span>Blog <span class="icon-keyboard_arrow_down"></span></a>
		<ul class="sub-menu">
			<li><a href="#"><span class="icon-label"></span>Sub-menu 1</a></li>
			<li><a href="#"><span class="icon-label"></span>Sub-menu 2</a></li>
			<li><a href="#"><span class="icon-label"></span>Sub-menu 3 <span class="icon-keyboard_arrow_right"></span></a>
				<ul class="child-sub-menu">
				<li><a href="#"><span class="icon-label"></span>Child sub-menu 1</a></li>
				<li><a href="#"><span class="icon-label"></span>Child sub-menu 2</a></li>
				<li><a href="#"><span class="icon-label"></span>Child sub-menu 3</a></li>
				<li><a href="#"><span class="icon-label"></span>Child sub-menu 4</a></li>
				</ul>
			</li>

			<li><a href="#"><span class="icon-label"></span>Sub-menu 4</a></li>
		</ul>
		</li>

		<li><a href=""><span class="icon-contact_mail"></span>Contact</a></li>
		
		<li><a href=""><span class="icon-more"></span>More <span class="icon-keyboard_arrow_down"></span></a>
		<ul class="sub-menu">
			<li><a href="#"><span class="icon-label"></span>Sub-menu 1</a></li>
			<li><a href="#"><span class="icon-label"></span>Sub-menu 2</a></li>
			<li><a href="#"><span class="icon-label"></span>Sub-menu 3</a></li>
			<li><a href="#"><span class="icon-label"></span>Sub-menu 4 <span class="icon-keyboard_arrow_right"></span></a>
				<ul class="child-sub-menu">
				<li><a href="#"><span class="icon-label"></span>Child sub-menu 1</a></li>
				<li><a href="#"><span class="icon-label"></span>Child sub-menu 2</a></li>
				<li><a href="#"><span class="icon-label"></span>Child sub-menu 3</a></li>
				<li><a href="#"><span class="icon-label"></span>Child sub-menu 4</a></li>
				</ul>
			</li>
		</ul>
		</li>
	</ul>
	</nav>

</div>

<section  class="section-home">
	<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
	tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
	quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
	consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
	cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
	proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
	tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
	quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
	consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
	cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
	proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
	tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
	quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
	consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
	cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
	proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
	tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
	quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
	consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
	cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
	proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
	</p>
</section>

</body>
</html>
              
            
!

CSS

              
                *{
	margin: 0;
	padding: 0;
	font-family: sans-serif;
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
}

body {
	background: #aeaeae;
}

.nav {
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	background: #fff;
	-webkit-box-shadow: 0 .2em .4em 0 #a0a0a0;
	box-shadow: 0 .2em .4em 0 #a0a0a0;
}
.nav .menu {
	width: 90%;
	margin: 0 5% 0 5%;
	list-style-type: none;
}

.nav .menu > li {
	float: left;
	position: relative;
}

.nav .menu .child-sub-menu > li,
.nav .menu .sub-menu > li {
	position: relative;
	float: none;
	border-bottom: solid .05em #f1f1f1;
}

.nav .menu .child-sub-menu > li > a:hover,
.nav .menu .sub-menu > li > a:hover,
.nav .menu > li > a:hover,
.nav .menu .current-menu {
	background: #f1f1f1;
}

.nav .menu .child-sub-menu > li > a > span:nth-child(1),
.nav .menu .sub-menu > li > a > span:nth-child(1),
.nav .menu > li > a > span:nth-child(1) {
	float: left;
	margin: 0 .4em 0 0;
}

.nav .menu .child-sub-menu > li > a > span:nth-child(2),
.nav .menu .sub-menu > li > a > span:nth-child(2),
.nav .menu > li > a >span:nth-child(2) {
	float: right;
	margin: 0 0 0 1em;
}

.nav .menu .sub-menu,
.nav .menu .child-sub-menu {
	display: none;
	background: #fff;
	position: absolute;
	left: 0;
	width: 200%;
	top: 100%;
	list-style-type: none;
	-webkit-box-shadow: 0 .2em .4em 0 #a0a0a0;
	box-shadow: 0 .2em .4em 0 #a0a0a0;
}

.nav .menu .child-sub-menu {
	left: 100%;
	top: 0%;
	width: 100%;
}

.nav .menu > li.active > .sub-menu,
.nav .menu .sub-menu > li.active .child-sub-menu {
	display: block;
}

.nav .menu .child-sub-menu > li > a,
.nav .menu .sub-menu > li > a,
.nav .menu > li > a {
padding: 1em;
font-size: 1em;
color: #444;
display: block;
text-decoration: none;
}

.header-menu .text-menu {
	font-size: 1em;
	padding: 1em;
	color: #444;
	float: left;
	cursor: pointer;
}

.header-menu .icon-menu:active {
	background: #f1f1f1;
}
.header-menu .icon-menu {
	font-size: 1em;
	padding: 1em;
	color: #444;
	float: left;
	border-radius: 100%;
	cursor: pointer;
}

.box-header-menu .header-menu {
	position: fixed;
	left: 0;
	top: 0;
	display: none;
	width: 100%;
	overflow: hidden;
	padding: 0 5% 0 5%;
	background: #fff;
	-webkit-box-shadow: 0 .2em .4em 0 #a0a0a0;
	box-shadow: 0 .2em .4em 0 #a0a0a0;
}

.box-account {
	display: none;
	padding: 1em;
	border-bottom: solid .1em #f1f1f1;
}

.box-photo-img {
	overflow: hidden;
	width: 4em;
	height: 4em;
	border-radius: 100%;
	border: solid 1em #f1f1f1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.box-photo-img img {
	height: 100%;
}

.box-name-user {
	padding: .4em 0;
}

.box-name-user h5,
.box-name-user h4 {
	font-size: 1em;
	color: #444;
	padding: .2em; 
	font-weight: bold;
}

.box-name-user h5 {
	font-size: .8em;
	color: #777;
	padding: 0 .3em; 	
}

.section-home {
	background: #fff;
	padding: 1em;
	width: 90%;
	margin: 3.2em 5% .4em 5%;
}

.section-home p{
	font-size: 1em;
	line-height: 1.4;
	text-align: justify;
}


#is_menu{
	display: none;
}

#is_menu:checked +.box-header-menu > .nav {
	left: 0;
	visibility: visible;
	opacity: 1;
	z-index: 100;
	-webkit-transition: all .35s ease-in-out;
	-o-transition: all .35s ease-in-out;
	transition: all .35s ease-in-out;
}

#is_menu:checked +.box-header-menu > .header-menu label {
	position: fixed;
	background: rgba(0,0,0,0.6);
	left: 0%;
	width: 100%;
	height: 100%;
	top: 0;
}

@media (max-width: 768px) {

	.box-account{
		display: block;
	}

	.section-home {
		width: 100%;
		margin: 2em 0 0 0;
	}
	.nav {
		overflow: auto;
		top: 0;
		left: -100%;
		width: 70%;
		opacity: 0;
		visibility: hidden;
		height: 100%;
	}

.box-header-menu .header-menu {
	display: block;
}

.nav .menu .child-sub-menu,
.nav .menu .sub-menu {
	width: 100%;
	left: auto;
	padding: 0 0 0 1em;
	top: auto;
	background: #f9f9f9;
	position: relative;
	-webkit-box-shadow: none;
	box-shadow: none;
}

.nav .menu .sub-menu > li > a > span:nth-child(2) {
	webkit-transform:rotate(90deg);
	-ms-transform:rotate(90deg);
	transform:rotate(90deg);
}


.nav .menu .child-sub-menu {
	background: #ececec;
	padding: 0 0 0 2em;
}

.nav .menu >li {
	float: none;
}

.nav .menu {
	margin: 0;
	width: 100%;
}

}

@media (max-width: 425px) {
	.nav {
		width: 80%;
	}
}
              
            
!

JS

              
                const navItems = [].slice.call(document.querySelectorAll('.menu li a'));

function toggleItem(e) {
  e.preventDefault();
  const { target: { parentNode } } = e;
  parentNode.classList.toggle('active');
}

navItems.forEach(navItem => {
  navItem.addEventListener('click', toggleItem);  
});

              
            
!
999px

Console