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

              
                <!-- Build a Pen with a mega menu -->
<header>
	<h1>Burger Joint</h1>
	<h1 id="menu_toggle" class="material-icons" style="font-size: 3.2em; cursor: pointer;">
		menu</h1>
	<nav id="navigation">
		<div class="div1">
			<h2>Menu</h2>
		</div>
		<div class="div2">
			<div id="menu_nav--burgers">
				<p>Burgers</p>
				<ul>
					<li>The Big Cheese</li>
					<li>The Big Veg</li>
					<li>The Double Big-Big</li>
					<li>The Big Boss</li>
					<li>The Little Big</li>
				</ul>
			</div>
			<div id="menu_nav--fries">
				<p>Fries</p>
				<ul>
					<li>Classic Fries</li>
					<li>Seasoned Fries</li>
					<li>Curly Fries</li>
					<li>Tater Tots</li>
				</ul>
			</div>
			<div id="menu_nav--salads">
				<p>Salads</p>
				<ul>
					<li>The Big 'Burg</li>
					<li>The Big Ceasar</li>
					<li>The Giant Garden</li>
				</ul>
			</div>
			<div id="menu_nav--shakes">
				<p>Shakes</p>
				<ul>
					<li>Big Vanilla</li>
					<li>Big Chocolate</li>
					<li>Big Strawberry</li>
					<li>Big Cookies & Creme</li>
				</ul>
			</div>
		</div>
		<div class="div3">
			<div id="location_nav">
				<p>Locations & Hours</p>
				<ul>
					<li>New York City</li>
					<li>Chicago</li>
					<li>San Francisco</li>
					<li>Los Angeles</li>
					<li>Philadelphia</li>
					<li>Toronto</li>
					<li>Vancouver</li>
				</ul>
			</div>
			<div id="takeout_nav">
				<p>Takeout & Delivery</p>
			</div>
			<div id="catering__nav">
				<p>Catering</p>
			</div>
			<div id="join-club_nav">
				<p>Join the Big Burger Club</p>
			</div>
		</div>
	</nav>
</header>
<main>
	<div id="sec1">
		<!-- 	Image from unsplash	 -->
		<img src="https://images.unsplash.com/photo-1586190848861-99aa4a171e90?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=580&q=80" alt="An image of burger">
		<div>
			<h1>Lorem ipsum dolor sit amet, consectetur</h1>
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus ad amet dolorem dolorum ex facilis hic impedit molestias, nemo nostrum pariatur quam quis ut. Deserunt fuga minus molestiae nesciunt totam!</p>
		</div>
	</div>
	<div id="sec2">
		<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Animi architecto, commodi deserunt enim et
			excepturi facilis fuga laborum nemo nesciunt nihil quas quasi ratione saepe velit vitae voluptates? Sunt,
			voluptate? Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto at debitis earum facere fugit quibusdam! Alias asperiores dolorem, esse ex excepturi fuga id labore minus neque nobis quam suscipit voluptates.</p>
		<p>Assumenda corporis fugit harum, iste officiis perspiciatis quasi sapiente voluptate? Amet consequatur
			deserunt dolorum eius explloremicabo facere facilis harum, mollitia necessitatibus nesciunt nobis quidem
			reprehenderit similique sint ullam ut velit.</p>
		<p>Aperiam autem delectus deserunt doloribus et ex expedita facere fuga hic incidunt ipsa itaque minima modi
			neque odio officia provident, ratione reprehenderit repudiandae sint sit sunt suscipit tenetur vel
			vitae Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda dolorum laborum, libero nostrum pariatur perspiciatis saepe tempore? Corporis deleniti, eaque illum pariatur tempore tenetur ullam! Aperiam deserunt est fugiat inventore.!</p>
		<p>Ad architecto deleniti dignissimos distinctio esse et eveniet explicabo ipsa iure nihil recusandae totam vel, Lorem ipsum dolor sit amet, consectetur adipisicing elit. A ad autem consectetur cum exercitationem fuga id iusto, laudantium minima necessitatibus pariatur reiciendis, temporibus vitae! Molestiae nihil officiis quaerat quos veniam? Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus accusantium ad architecto autem, dicta dolorem doloribus facere facilis fuga illum molestiae natus nisi nulla perferendis perspiciatis, quaerat quo sint soluta.
			voluptatem! Assumenda cupiditate, enim fugit officia quisquam soluta tenetur. Asperiores at doloremque
			officiis provident voluptatibus?</p>
		<p>Assumenda autem blanditiis, consectetur delectus dolorum eius eligendi error harum impedit labore laudantium
			maxime minus nemo neque nulla numquam quis, recusandae rem unde ut vel vitae voluptates voluptatum.
			Consectetur, nesciunt?</p>
	</div>
</main>
              
            
!

CSS

              
                @charset "UTF-8";
:root {
	font-size: 20px;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	position: relative;
	font-family: "Poppins", sans-serif;
}

li {
	list-style-type: none;
}

header {
	width: 100%;
	height: 5em;
	padding: 0.5em 4em;
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	justify-content: space-between;
	align-items: center;
}
header > h1 {
	display: inline-block;
}

.menu-open header {
	padding: 0.5em 4em 0 4em;
	min-height: 100vh;
	height: auto;
}

#navigation {
	width: 100%;
	height: 0;
	overflow: hidden;
	padding: 0;
	background: #fffa4d;
	color: black;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: 1fr;
	grid-column-gap: 10px;
	grid-row-gap: 10px;
	border-top-left-radius: 1em;
	border-top-right-radius: 1em;
	opacity: 0;
	transition: all 0.5s ease;
	border-top: 2px solid #000;
	border-left: 2px solid #000;
	border-right: 2px solid #000;
}
#navigation > div {
	padding: 0.5em;
}
#navigation > div li {
	transition: margin-left 0.3s ease;
	cursor: pointer;
}
#navigation > div li:before {
	content: "→";
	position: absolute;
	right: 100%;
	opacity: 0;
	transition: opacity 0.3s ease;
}
#navigation > div li:hover {
	margin-left: 0.5em;
}
#navigation > div li:hover:before {
	opacity: 1;
}
#navigation p {
	font-size: 1.1em;
	font-weight: 700;
}
#navigation > .div1 {
	grid-area: 1/1/2/2;
}
#navigation > .div1 h2 {
	font-size: 6em;
}
#navigation > .div2 {
	grid-area: 1/2/2/4;
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	row-gap: 1em;
	column-gap: 0.5em;
}
#navigation > .div2 div {
	width: calc(50% - 0.5em);
}
#navigation > .div3 {
	grid-area: 1/4/2/5;
	border-left: 0.2em solid #000;
}
#navigation > .div3 div {
	margin: 1em 0;
}
#navigation > .div3 div:first-child {
	margin-top: 0;
}
#navigation > .div3 div:last-child {
	margin-bottom: 0;
}
#navigation > .div3 #takeout_nav,
#navigation > .div3 #catering__nav,
#navigation > .div3 #join-club_nav {
	cursor: pointer;
}

.menu-open #navigation {
	height: calc(100vh + 4.5em);
	padding: 1em 0;
	opacity: 1;
	transition: all 0.5s ease;
}

body {
	background-color: #fff91a;
}

body.menu-open {
	height: calc(100vh + 15em);
}

main {
	padding-inline: 4em !important;
}

#sec1 {
	height: calc(100vh - 5em);
	opacity: 1;
	transition: all 0.5s 0.4s ease;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
#sec1 img {
	width: 40%;
}
#sec1 div {
	width: 50%;
}
#sec1 div h1 {
	font-size: 3em;
}

.menu-open #sec1 {
	opacity: 0;
	transition: all 1s ease;
}

#sec2 p {
	padding-left: 10em;
	margin: 1.5em 0;
}

              
            
!

JS

              
                let flag = true;

$("#menu_toggle").click(function () {
	$("body").toggleClass("menu-open");
	if (flag === true) {
		$("#menu_toggle").text("close");
		$(window).lockscroll(true);
		flag = false;
	} else {
		$("#menu_toggle").text("menu");
		$(window).lockscroll(false);
		flag = true;
	}
});

              
            
!
999px

Console