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

              
                <div class="wrapper">
	<img class="burger" src="https://assets.codepen.io/t-1/lefteris-kallergis-_TLKIVSW6Do-unsplash.jpg" alt="">
	<h1 class="slide"><span class="letters">Bessie's Big Buns</span></h1>
	<h1 class="rest">& Burgers</h1>
</div>

<div class="navbar">

	<div class="dropdown">
		<button class="dropbtn">
			Locations
			<i class="fa fa-caret-down"></i>
		</button>
		<div class="dropdown-content">
			<div class="header">
				<h2>Bessie's Burger Bars</h2>
			</div>
			<div class="row">
				<div class="column-half">
					<a href="#0">Manchester</a>
					<a href="#0">York</a>
					<a href="#0">Leeds</a>
					<a href="#0">Bridport</a>
				</div>
				<div class="column-half">
					<a href="#0">Caerphilly</a>
					<a href="#0">Fakenham</a>
					<a href="#0">Gloucester</a>
					<a href="#0">Cardiff</a>
				</div> <!-- end column -->
			</div> <!-- end row -->
		</div> <!-- end dropdown content -->
	</div> <!-- end dropdown -->

	<div class="dropdown">
		<button class="dropbtn">
			Mega Munchie Menu
			<i class="fa fa-caret-down"></i>
		</button>
		<div class="dropdown-content">
			<div class="header">
				<h2>Mega Munchies</h2>
			</div>
			<div class="row">
				<div class="column">
					<h3>Burgers</h3>
					<a href="#0">Bessie's Big Buns</a>
					<a href="#0">The Big Bessie</a>
					<a href="#0">The Big Cheese</a>
					<a href="#0">The Big Veg</a>
					<a href="#0">The Double-Big Bessie</a>
					<a href="#0">The Baby Bessie</a>
				</div>

				<div class="column">
					<h3>Fries</h3>
					<a href="#0">Classic Fries</a>
					<a href="#0">Seasoned Fries</a>
					<a href="#0">Curly Fries</a>
					<a href="#0">Fried Fries</a>
					<a href="#0">Tiny Tatties for Tiny Tots</a>
				</div>

				<div class="column">
					<h3>Salads</h3>
					<a href="#0">The Big Rockafella</a>
					<a href="#0">The Big Caesar</a>
					<a href="#0">The Giant Garden</a>
					<a href="#0">The Gargantuan Guacamole</a>
					<a href="#0">Little leaves for little people</a>
				</div>

				<div class="column">
					<h3>Shakes</h3>
					<a href="#0">Big Vanilla</a>
					<a href="#0">Big Chocolate</a>
					<a href="#0">Big Strawberry</a>
					<a href="#0">Big Cookies & Creme</a>
					<a href="#0">Small shakes</a>
				</div> <!-- end column -->
			</div> <!-- end row -->
		</div> <!-- end dropdown content -->
	</div> <!-- end dropdown -->

	<a href="#0">Takeout & Delivery</a>
	<a href="#0">Catering</a>
	<a href="#0">Contact</a>

</div> <!-- end navbar -->

<div class="article">
	<h2>Tickle your taste buds with these tasty dishes</h2>
	<div class="article-contents">
		<div>
			<img class="main" src="https://assets.codepen.io/t-1/lefteris-kallergis-_TLKIVSW6Do-unsplash.jpg" alt="a vegetarian burger with a quinoa patty and lots of vegetable fixins.">
			<!-- photo by Lefteris kallergis for Unsplash. Full-size image at: https://unsplash.com/photos/_TLKIVSW6Do -->
		</div>
		<div>
			<h3>Vegetarian burgers</h3>
			<p>Vegetarian quinoa and mozarella burger with chilli jam, gherkins, lettuce, mayo, and loads of fresh salad.</p>
		</div>

		<div>
			<img class="main" src="https://assets.codepen.io/t-1/jay-gajjar-vsYCZVef28E.jpg" alt="french fries seasoned with garlic and spices in a brown craft paper container. ">
			<!-- photo by Jay Gajjar for Unsplash. Full-size image at: https://unsplash.com/photos/vsYCZVef28E -->
		</div>
		<div>
			<h3>Our tasty fries</h3>
			<p>French fries seasoned with fresh garlic and spices, topped with a sprig of parsley, in a brown craft paper container.</p>
			<p>Being kind to the environment as well as to your stomach.</p>
		</div>

		<div>
			<img class="main" src="https://assets.codepen.io/t-1/melissa-walker-horn-NkwNp3ho-Qw-unsplash.jpg" alt="a burger, fries, and a beer on a restaurant table. ">
			<!-- photo by Melissa Walker Horn for Unsplash. Full size image at: https://unsplash.com/photos/NkwNp3ho-Qw -->
		</div>
		<div>
			<h3>Treat yourself</h3>
			<p>A burger, fries, and a cold, cold beer to soothe your cares away.</p>
			<p>Real comfort food.</p>
		</div>
	</div>
</div>

<footer>
	Footer
</footer>
              
            
!

CSS

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

body {
	margin: 0;
	font-size: 16pt;
}

.wrapper {
	width: 100%;
	margin: 0;
	padding: 1em 0;
	display: grid;
	place-items: center;
	background: #e78c38;
	z-index: -10;
}
.slide .wrapper {
	position: relative;
	display: inline-block;
	overflow: hidden;
}
.slide,
.rest {
	position: relative;
	font-family: "Laila", sans-serif;
	font-size: 8vmin;
}
.slide .letter {
	display: inline-block;
	line-height: 1em;
	transform: translateX(100px);
	opacity: 0;
}
.rest {
	transform: translateY(30px);
	opacity: 0;
}

h1 {
	text-align: center;
}
h2 {
	font-family: "Laila", sans-serif;
	font-size: 5vmin;
	margin-bottom: 1.5rem;
}
.header h2 {
	margin: 0;
}
img.burger {
	float: left;
	width: 35vmin;
	border-radius: 50%;
}

.navbar {
	overflow: hidden;
	background-color: #c11d00;
	font-family: "Laila", sans-serif;
	font-size: 3.25vmin;
	z-index: 10;
}
.navbar a {
	float: left;
	color: white;
	text-align: center;
	padding: 1.5em;
	text-decoration: none;
}
.navbar a:hover,
.dropdown:hover .dropbtn {
	background-color: #e78c38;
}

.dropdown {
	float: left;
	overflow: hidden;
}
.dropdown .dropbtn {
	border: none;
	outline: none;
	color: white;
	padding: 1.5em;
	background-color: inherit;
	font: inherit;
	margin: 0;
	cursor: pointer;
}
.dropdown-content {
	display: none;
	position: absolute;
	background-color: #fade97;
	width: 100%;
	left: 0;
	box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.5);
	z-index: 1;
	opacity: 1;
	transform: translateY(-100%);
	transition: transform 0.3s ease-out;
}
.dropdown-content .header {
	background: #e78c38;
	padding: 16px;
	color: white;
}
.dropdown:hover .dropdown-content {
	display: block;
	opacity: 1;
	transform: translateY(0);
}

/* Create four equal columns that float next to each other */
.column {
	float: left;
	width: 25%;
	height: 100%;
	padding: 10px;
	background-color: #fade97;
}
.column-half {
	float: left;
	width: 50%;
	height: 100%;
	padding: 1em 2em;
	background-color: #fade97;
}
/* style the content of the columns */
.column h3,
.article-contents h3 {
	font-family: "Laila", sans-serif;
}
.column h3 {font-size: 4.5vmin;}
.article-contents h3 {1.5rem;}
.column a,
.column-half a {
	float: none;
	color: #333;
	padding: 16px;
	text-decoration: none;
	display: block;
	text-align: left;
	text-transform: capitalize;
	transition: 0.3s ease-out;
}
.column a:hover,
.column-half a:hover {
	color: white;
	background-color: #e78c38;
}

/* Clear floats after the columns */
.row:after {
	content: "";
	display: table;
	clear: both;
}

.article {
	width: 100%;
	padding: 2em 3em;
	margin: auto;
	background: #e6f9e6;
}
.article-contents {
	display: grid;
	grid: auto / 1fr 1fr;
	place-items: center;
	gap: 3em;
}
@media screen and (max-width: 750px) {
	.article-contents {
		grid: auto / 1fr;
		gap: 0;
		margin-top: 3em;
	}
	.article-contents div:nth-child(even) {
		margin-bottom: 2em;
	}
}
.article img {
	max-width: 100%;
	float: left;
	margin: 2rem 1rem 1rem 0;
	border: 1px solid black;
	border-radius: 5px;
	box-shadow: 10px 10px 30px -15px #333;
}
.article p {
	font-family: Verdana, sans-serif;
	font-size: 1.5rem;
	line-height: 1.5;
	margin: 1em 0;
}

footer {
	width: 100%;
	height: 5rem;
	display: grid;
	place-items: center;
	background-color: #c11d00;
	font-family: "Laila", sans-serif;
	font-size: 2rem;
	color: white;
}
/*
@media screen and (max-width: 650px) {
	.dropdown .dropbtn {
		padding: 0.5em;
	}
	.row {
		display: flex;
		flex-flow: row wrap;
	}
	.column,
	.column-half {
		padding: 1em;
	}
	.article-contents {
		grid: auto / 1fr;
	}
	.article img {
		margin: 2em auto 0;
	}
	.article p {
		margin: 1em 0;
	}
}
*/

              
            
!

JS

              
                // Wrap every letter of first line in a span
var wrapper = document.querySelector(".slide .letters");
wrapper.innerHTML = wrapper.textContent.replace(
	/\S/g,
	"<span class='letter'>$&</span>"
);
gsap.to(".slide .letter", {
	x: 0,
	easeEach: "sine.inOut",
	opacity: 1,
	duration: 0.5,
	delay: 0.5,
	stagger: {
		amount: 1,
		from: "start"
	}
});

var tl = gsap.timeline();
tl.from("h2", {
	x: -50,
	opacity: 0,
	delay: 0.75
});
tl.from("img.main", {
	y: 50,
	opacity: 0
});
tl.from("img.burger", {
	y: -150,
	opacity: 0,
	delay: 0.25,
	ease: "bounce"
});
tl.to(".rest", {
	y: 0,
	ease: "back.out",
	opacity: 1,
	delay: 0.75
});
gsap.from(".article-contents h3", {
	x: 50,
	opacity: 0,
	delay: 1.25
});
gsap.from(".article p", {
	x: 50,
	opacity: 0,
	delay: 1.5
});

              
            
!
999px

Console