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

              
                <nav class="menu container">
	<div class="logo">
		<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 554 168" style="enable-background:new 0 0 554 168;" xml:space="preserve">
			<style type="text/css">
				.st0 {
					fill: #D80E0E;
				}
			</style>
			<g>
				<path class="st0" d="M79.3,93.2c-0.6,0-0.9,0.4-0.9,1.2v21.2c0,0.6,0.3,1,1,1c2.3,0,4.4-1.7,4.4-4.2V97.1
		C83.8,94.7,81.6,93.2,79.3,93.2z" />
				<path class="st0" d="M206.4,60c-0.7,0-1.2,0.4-1.2,1.3v13.3c0,1,0.3,1.3,1,1.3c3.5,0,3.5-4.1,3.5-10.7
		C209.7,61.9,207.7,60,206.4,60z" />
				<path class="st0" d="M79.4,71.5c2,0,4.2-1.3,4.2-4.2V54.8c0-2.6-2.5-3.8-4.2-3.8c-0.6,0-1,0.3-1,0.9v18.6
		C78.4,71,78.9,71.5,79.4,71.5z" />
				<path class="st0" d="M0,0v168h554V0H0z M80.9,138.3h-27c-1,0-1.5-0.7-1.5-1.6V31.3c0-1,0.6-1.7,1.6-1.7h27
		c18.9,0,29.6,14.1,29.6,26.1c0,8.7-0.1,22-14.8,26.5v0.3c9.1,3.3,15.2,13.1,15.2,24.4C111.1,114.2,110.9,138.3,80.9,138.3z
		 M171.1,136.7c0,0.9-0.7,1.6-1.6,1.6h-51.9c-0.9,0-1.6-0.9-1.6-1.9v-105c0-0.9,0.9-1.9,1.9-1.9h51.5c0.9,0,1.5,0.7,1.5,1.6v26.1
		c0,0.9-0.7,1.5-1.6,1.5H145c-0.6,0-1,0.4-1,1v8.1c0,0.6,0.6,1,1,1h11.5c0.6,0,1,0.4,1,1v26.4c0,0.7-0.6,1.3-1.2,1.3h-11.7
		c-0.6,0-1,0.4-1,1.2v8.6c0,0.6,0.4,1,0.9,1h25.1c1,0,1.6,0.7,1.6,1.5V136.7z M227.2,138.6c-10.4,0-17.4-7.3-17.4-20.9V95.4
		c0-4.6-2-7-3.6-7c-0.9,0-1,0.7-1,1.7v46.4c0,0.9-0.7,1.7-1.7,1.7h-24.8c-1,0-1.7-0.7-1.7-1.9V31.3c0-1,0.7-1.7,1.6-1.7h32.3
		c12.8,0,28,9.9,28,27.6c0,7.8-1.5,22.2-15.2,24.2v0.3c17.7,5.1,17.7,14.5,17.7,29.3c0,1.7,0.7,3.5,3.9,4.8c0.7,0.4,1.3,1.5,1.3,2
		C246.5,137.5,232,138.6,227.2,138.6z M309.6,56.8c0,1.2-0.9,2-2,2h-14.5c-1,0-1.7,0.7-1.7,2v75.6c0,1-0.9,1.9-2,1.9h-24.7
		c-1,0-2-0.9-2-2V60.6c0-1-0.9-1.7-1.9-1.7h-14.5c-0.9,0-1.9-1.2-1.9-2V31c0-0.9,0.4-1.5,1.3-1.5h62.1c1,0,1.9,0.6,1.9,1.7V56.8z
		 M342.6,136.4c0,0.9-0.7,1.9-1.7,1.9h-24.2c-1,0-1.9-1-1.9-2.2V31c0-0.7,0.6-1.5,1.3-1.5h24.8c1,0,1.7,0.6,1.7,1.5V136.4z
		 M403.5,136.7c0,0.9-0.7,1.6-1.6,1.6H350c-0.9,0-1.6-0.9-1.6-1.9v-105c0-0.9,0.9-1.9,1.9-1.9h51.5c0.9,0,1.5,0.7,1.5,1.6v26.1
		c0,0.9-0.7,1.5-1.6,1.5h-24.2c-0.6,0-1,0.4-1,1v8.1c0,0.6,0.6,1,1,1h11.5c0.6,0,1,0.4,1,1v26.4c0,0.7-0.6,1.3-1.2,1.3h-11.7
		c-0.6,0-1,0.4-1,1.2v8.6c0,0.6,0.4,1,0.9,1h25.1c1,0,1.6,0.7,1.6,1.5V136.7z M434.4,31.1l-9.9,24.5c-0.3,0.6-0.7,0.9-1.3,0.9h-13.8
		c-0.6,0-1.2-0.4-1-1l5.4-24.9c0.1-0.6,0.4-1,1.2-1h18.6C434.4,29.5,434.7,30.4,434.4,31.1z M484.9,76.2
		c9.4,6.4,16.5,16.8,16.5,27.6c0,19.4-11.6,35-30.6,35c-22,0-32.2-16-32.2-39.2c0-0.7,0.6-1.5,1.7-1.5l20-1c1,0,1.6,0.6,1.7,1.9
		c0.6,5.8,3,12,6.5,12c2,0,3.3-1.3,3.3-4.6c0-3.5-8.1-9.9-17.8-17.7c-9.7-7.8-14.5-18.7-14.5-28.6c0-14.8,11-30.9,30.5-30.9
		c19.4,0,31.5,15.2,31.5,32.5c0,1-0.6,1.9-1.7,1.9l-22.2,1c-0.9,0-1.5-0.4-1.7-1.6c-0.9-3.5-2.3-5.2-4.4-5.2c-1.5,0-2.2,1.2-2.2,2.6
		C469.3,65.1,476.2,70.3,484.9,76.2z" />
			</g>
		</svg>
	</div>

	<ul>
		<li class="has-dropdown" data-content="locations">Locations & Hours</li>
		<li class="has-dropdown" data-content="burgers">Burgers</li>
		<li class="has-dropdown" data-content="fries">Fries</li>
		<li class="has-dropdown" data-content="salads">Salads</li>
		<li class="has-dropdown" data-content="shakes">Shakes</li>
	</ul>

	<div class="dropdown-content">

		<div class="content" data-content="locations">
			<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 class="picture">

			</div>

		</div>
		<div class="content" data-content="burgers">
			<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 class="picture">

			</div>
		</div>
		<div class="content" data-content="fries">
			<ul>
				<li>Classic Fries</li>
				<li>Seasoned Fries</li>
				<li>Curly Fries</li>
				<li>Tater Tots</li>
			</ul>
			<div class="picture">

			</div>
		</div>
		<div class="content" data-content="salads">
			<ul>
				<li>The Big 'Burg</li>
				<li>The Big Ceasar</li>
				<li>The Giant Garden</li>
			</ul>
			<div class="picture">

			</div>
		</div>
		<div class="content" data-content="shakes">
			<ul>
				<li>Big Vanilla</li>
				<li>Big Chocolate</li>
				<li>Big Strawberry</li>
				<li>Big Cookies & Creme</li>
			</ul>
			<div class="picture">

			</div>
		</div>

	</div>

</nav>

<section class="hero container">

	<h1>BERTIE'S <span>BIG</span> BURGERS</h1>

	<div class="hamburger">
		<img src="https://lilbotmedia.com/burger-cpc.png" alt="hamburger" </div>

</section>
              
            
!

CSS

              
                :root {
	--main-bg: #f5ebdc;
	--main-logo-color: #d80e0e;
	--text-color: rgb(80, 35, 20);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	heigth: 100%;
}

body {
	background: var(--main-bg);
	font-family: "Passion One", cursive;
	color: var(--text-color);
	padding: 1rem;
}

ul {
	list-style: none;
}

img,
svg {
	max-width: 100%;
}

.container {
	margin: 0 auto;
	max-width: 1300px;
}

.menu {
	display: flex;
	align-items: center;
	padding: 1.5rem 2rem;
	position: relative;
	flex-wrap: wrap;
}

.logo {
}

.logo svg {
	width: 100%;
	max-width: 120px;
}

.menu > ul {
	padding-right: 1rem;
	display: flex;
	justify-content: end;
	gap: 2rem;
	flex: 1;
	letter-spacing: 1px;
}

.has-dropdown {
	position: relative;
}

.has-dropdown:hover {
	cursor: pointer;
}

.has-dropdown::before,
.has-dropdown::after {
	content: "";
	position: absolute;
	background: var(--main-logo-color);
	height: 2px;
	width: 10px;
	top: 50%;
	right: -13px;
	transition: transform 250ms ease;
}

.has-dropdown::before {
	transform: translateY(-50%);
}

.has-dropdown::after {
	transform: translateY(-50%) rotate(90deg);
}

.has-dropdown.active::after {
	transform: translateY(-50%) rotate(0);
}

.dropdown-content.active {
}

.content {
	display: flex;
	gap: 2rem;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	font-size: 3rem;
	visibility: hidden;
	opacity: 0;
	width: 100%;
	outline: 1px solid var(--text-color);
	transition: 350ms ease;
	z-index: 1;
	padding: 2rem;
	transform: translateY(20px);
}

.content ul {
	display: grid;
	flex: 1;
}

.content ul li {
	padding: 1rem 1rem;
	transition: 250ms ease;
}

.content ul * + * {
	border-top: 1px solid var(--text-color);
}

.content ul li:hover {
	background: var(--text-color);
	color: var(--main-bg);
	cursor: pointer;
}

.content::before {
	position: absolute;
	content: attr(data-content);
	text-transform: capitalize;
	top: -20px;
	right: 0;
	padding: 0.5rem 2rem;
	background: var(--main-bg);
	outline: 1px solid var(--text-color);
}

.picture {
	object-fit: cover;
	flex: 1;
	background-size: cover;
	background-position: center;
}

.content.active {
	background: var(--main-bg);
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
}

.hero {
	min-height: 80vh;
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	padding: 2rem;
}

.hero h1 {
	font-size: clamp(3rem, 10vw, 8.5rem);
	line-height: 0.8;
}

.hero h1 span {
	color: var(--main-logo-color);
}

.hamburger {
	display: flex;
	justify-content: end;
	align-items: center;
}

.hamburger img {
	width: 500px;
}

              
            
!

JS

              
                console.clear();

const navMenuItems = document.querySelectorAll(".has-dropdown");
const dropdownContentContainer = document.querySelector(".dropdown-content");
const content = document.querySelectorAll(".content");
const pictures = document.querySelectorAll(".picture");
const imgUrls = [
	"https://images.unsplash.com/photo-1619468129361-605ebea04b44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1171&q=80",
	"https://assets.codepen.io/t-1/melissa-walker-horn-NkwNp3ho-Qw-unsplash.jpg",
	"https://assets.codepen.io/t-1/jay-gajjar-vsYCZVef28E.jpg",
	"https://images.unsplash.com/photo-1537785713284-0015ce8a145c?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80",
	"https://images.unsplash.com/photo-1586985289071-36f62f55ce44?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=687&q=80"
];

pictures.forEach((pic, index) => {
	pic.style.backgroundImage = `url(${imgUrls[index]})`;
});

for (let item of navMenuItems) {
	item.addEventListener("click", () => {
		navMenuItems.forEach((menuItem) => {
			if (menuItem.classList.contains("active") && menuItem != item) {
				menuItem.classList.remove("active");
			}
		});

		item.classList.toggle("active");

		for (let elem of content) {
			if (
				elem.classList.contains("active") &&
				elem.dataset.content != item.dataset.content
			) {
				elem.classList.remove("active");
			}

			if (elem.dataset.content === item.dataset.content) {
				elem.classList.toggle("active");
			}
		}
	});
}

              
            
!
999px

Console