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

              
                <!-- mobile-first -->
<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<link rel="stylesheet" href="styles.css" />
	<title>Boba Tea Truck</title>
	<script src="https://kit.fontawesome.com/41c8573884.js" crossorigin="anonymous"></script>
</head>

<body>
	<main>
		<!-- back to top button -->
		<button onclick="topFunction()" id="top-button" title="Go to top">
			<i class="fas fa-arrow-circle-up"></i>
		</button>
		<!-- header with logo -->
		<header>
			<a class="logo grid" href="">
				<img class="logo-icon" src="https://www.svgrepo.com/show/215657/drink-straw.svg" alt="boba tea truck logo" />
				<p class="logo-name">Boba Tea Truck</p>
				<img class="logo-image" src="https://images.unsplash.com/photo-1563861019306-9cccb83bdf0c?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=2071&q=80" alt="photo by karen z on unsplash" />
			</a>
		</header>

		<!-- navigation -->
		<nav class="site-nav" class="grid">
			<ul>
				<li><a href="">Menu</a></li>
				<li><a href="">Nutrition</a></li>
				<li><a href="">Contact</a></li>
				<li><a href="">Locations</a></li>
			</ul>
		</nav>

		<!-- articles section-->
		<!-- 3 articles -->
		<div class="articles grid">
			<article>
				<img src="https://www.presstelegram.com/wp-content/uploads/2021/04/LDN-L-DINE-POKE-0409-04-1.jpg" alt="poke bowl" />
				<h2>Poke Bowl</h2>
				<p>
					Velit anim ea duis voluptate. Voluptate mollit aute ad est
					commodo. Voluptate proident ex exercitation dolor consectetur
					commodo anim nostrud commodo laborum incididunt culpa aute.
				</p>
			</article>
			<article>
				<img src="https://www.willcookforsmiles.com/wp-content/uploads/2019/09/Chicken-Teriyaki-Rice-Bowl-6-1-scaled.jpg" alt="teriyaki rice bowl" />
				<h2>Chicken Teriyaki Rice Bowl</h2>
				<p>
					Officia mollit pariatur ex labore aliquip. Proident eiusmod
					dolor ea incididunt amet aliquip culpa incididunt ullamco.
					Exercitation est eiusmod ea non.
				</p>
			</article>
			<article>
				<img src="https://images.mktw.net/im-324715?width=1280&size=1" alt="boba tea" />
				<h2>Boba Tea</h2>
				<p>
					Id qui fugiat labore culpa laborum quis elit anim. In esse
					elit laborum enim dolore aliquip nulla. Dolore labore minim
					irure ea ullamco occaecat aute ullamco culpa fugiat ad ex
					dolore irure.
				</p>
			</article>
		</div>

		<!-- footer -->
		<footer>
			<div class="grid">
				<p class="copyright">
					Raya Bergin LBCC Fall2021 COSW20 &copy; 19|22Oct2021
				</p>
				<p class="privacy"><a href="">Privacy Policy</a></p>
				<p class="terms"><a href="">Terms of Use</a></p>
				<ul class="social">
					<li>
						<a href=""><i class="fab fa-instagram-square"></i></a>
					</li>
					<li>
						<a href=""><i class="fab fa-pinterest-square"></i></a>
					</li>
				</ul>
			</div>
		</footer>
		<script src="myscripts.js"></script>
	</main>
</body>

</html>
              
            
!

CSS

              
                /* MY TEMPLATE */
* {
	/* Outline to view layout on screen while styling | Remove after styling */
	/* outline: 1px dashed #ff0075; */
	margin: 0;
	padding: 0;
}
html {
	box-sizing: border-box;
	font-size: 100%;
}
*,
*:before,
*:after {
	box-sizing: inherit;
}

/* BASIC styles */

/* FONTS */
/* headers */
@import url("https://fonts.googleapis.com/css2?family=Raleway:wght@300&display=swap");
/* body */
@import url("https://fonts.googleapis.com/css2?family=Lato&display=swap");

/* COLOR palette */
/* #edfdfb
	#04030f
	#ff0022
	#b9bab8
	#f8e9f2  */

body {
	background: #04030f;
	color: #04030f;
	font-family: "Lato", sans-serif;
}
main {
	background: #edfdfb;
}
h2 {
	font-family: "Raleway", sans-serif;
	font-weight: normal;
}
a {
	text-decoration: none;
}
li {
	list-style-type: none;
}

/* BEGIN default CSS mobile design */
/* 8-column grid */
.grid {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: 1em;
}

/* header with logo */
.logo {
	justify-items: center;
	background: #f8e9f2;
	text-align: center;
}
.logo .logo-icon {
	grid-column: 4/6;
	width: 3.5em;
	margin-top: 1em;
}
.logo .logo-name {
	grid-column: 1/9;
	color: #ff0022;
	text-transform: lowercase;
	font-size: 1.75rem;
	letter-spacing: 0.1em;
}
.logo .logo-image {
	grid-column: 1/9;
	max-width: 100%;
}

/* navigation */
.site-nav ul {
	text-align: center;
	background: #b9bab8;
}
.site-nav ul li {
	padding: 1.15em 3.75em;
	font-size: 1.5rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	list-style-type: none;
	border: 1px solid rgba(255, 0, 34, 0.5);
	border-left: 0;
	border-right: 0;
	z-index: 1;
}
.site-nav ul li a {
	color: #04030f;
}

/* articles section */
.articles {
	margin-top: 1em;
	justify-items: center;
	padding-bottom: 1em;
}
.articles article {
	grid-column: 1/9;
	padding: 0 4%;
}
.articles article img {
	border-radius: 5em;
}
.articles article img,
.articles article h2 {
	text-align: center;
}
.articles article * {
	margin: 0.25em 0;
	max-width: 100%;
}

/* footer */
footer {
	padding: 0.5em 3% 2.25em;
	background-color: #f8e9f2;
	background-image: url(https://www.svgrepo.com/show/251617/food-truck.svg);
	background-size: 10%;
	background-repeat: no-repeat;
	background-position: bottom center;
}
footer .copyright,
footer .privacy,
footer .terms {
	font-size: 0.75rem;
}
footer * {
	justify-items: center;
	grid-column: 1/9;
}
footer .social {
	display: flex;
}
footer li {
	margin: 0.25em;
}

/* back to top button */
#top-button {
	display: none;
	position: fixed;
	bottom: 1em;
	right: 1em;
	z-index: 2;
	font-size: 1.25rem;
	border: none;
	outline: none;
	background-color: #ff0022;
	color: #edfdfb;
	cursor: pointer;
	padding: 0.5em;
	border-radius: 5px;
}
#top-button:hover {
	background-color: #b9bab8;
}

/* BEGIN tablet styles */
/* min-width 620px */
@media screen and (min-width: 620px) {
	/* header with logo */
	.logo {
		margin-top: 1.5em;
	}
	.logo .logo-image {
		padding: 1.5em;
		border-radius: 2em;
	}

	/* navigation */
	.site-nav ul {
		display: flex;
		flex-wrap: wrap;
	}
	.site-nav ul li {
		width: 25%;
		flex-basis: 50%;
		padding: 1em 0;
		border-left: 1px solid rgba(255, 0, 34, 0.5);
		border-right: 1px solid rgba(255, 0, 34, 0.5);
		/* 		border-radius: 1em; */
		background-color: rgba(255, 0, 34, 0.4);
	}
	.site-nav ul li a {
		color: #edfdfb;
	}

	/* articles section */
	.articles {
		margin-top: 1em;
	}
	.articles article {
		padding: 1em 4%;
	}
	.articles article h2 {
		font-size: 1.5rem;
		letter-spacing: 0.1em;
		font-weight: 600;
	}
	.articles article p {
		font-size: 1.25rem;
	}

	/* footer */
	footer {
		padding: 1em 1em 4.5em;
		margin-bottom: 1.5em;
	}
	footer .copyright,
	footer .privacy,
	footer .terms {
		font-size: 1.25rem;
	}

	/* back to top button */
	#top-button {
		bottom: 1em;
		right: 1em;
		font-size: 1.5rem;
	}
}

/* BEGIN laptop styles to desktop */
/* min-width 1024px */
@media screen and (min-width: 1024px) {
	body {
		width: 100%;
		max-width: 64em;
		margin: 0 auto;
	}

	/* header with logo */
	.logo .logo-image {
		padding: 2em;
		border-radius: 3em;
	}

	/* navigation */
	.site-nav ul {
		display: flex;
		flex-wrap: nowrap;
	}
	.site-nav ul li {
		font-size: 1.25rem;
	}

	/* articles section */
	.articles article {
		border: 1px solid rgba(255, 0, 34, 0.5);
		border-radius: 1em;
	}
	.articles article:nth-child(1) {
		grid-column: 2/4;
	}
	.articles article:nth-child(2) {
		grid-column: 4/6;
	}
	.articles article:nth-child(3) {
		grid-column: 6/8;
	}
	.articles article img {
		border-radius: 1em;
	}
	.articles article h2 {
		font-size: 1.25rem;
		letter-spacing: 0.05em;
		font-weight: 500;
	}
	.articles article p {
		font-size: 1rem;
	}

	/* footer */
	footer {
		background-size: 6%;
		padding: 1em 1em 4.5em;
	}
	footer .copyright,
	footer .privacy,
	footer .terms {
		font-size: 0.95rem;
	}
}

              
            
!

JS

              
                //Get the button
var mybutton = document.getElementById("top-button");

// When the user scrolls down 300px from the top of the document, show the button
window.onscroll = function () {
	scrollFunction();
};

function scrollFunction() {
	if (
		document.body.scrollTop > 300 ||
		document.documentElement.scrollTop > 300
	) {
		mybutton.style.display = "block";
	} else {
		mybutton.style.display = "none";
	}
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
	document.body.scrollTop = 0;
	document.documentElement.scrollTop = 0;
}

              
            
!
999px

Console