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

              
                <header id="header">
<nav id="nav-bar">
	<ul class="navbar">
		<li><a class="nav-link" href="#"><img id="header-img" src="https://upload.wikimedia.org/wikipedia/commons/thumb/7/72/Cup_of_coffee.svg/2000px-Cup_of_coffee.svg.png" alt="Coffee Logo Image"></a></li>
		<li id="businessname"><strong><a class="nav-link" href="#">The Roost Cafe</a></strong></li>
		<li><a class="nav-link" href="#features">Features</a></li>
		<li><a class="nav-link" href="#learnmore">How it works</a></li>
		<li><a class="nav-link" href="#product-range">Product range</a></li>
	</ul>
</nav>
</header>
<section class="section-content" id="main">
	<div id="tagline">
		<h1>The coffee experience you have always wanted</h1>
	</div>
</section>
<section class="section-content" id="features">
		<ul>
			<li><i class="fas fa-coffee"></i>Order your favourite coffee from Brewster</li>
			<li><i class="fas fa-coffee"></i>Get a part time job at the café</li>
			<li><i class="fas fa-coffee"></i>Learn all about your villagers' coffee preferences</li>
			<li><i class="fas fa-coffee"></i>Meet special Animal Crossing characters</li>
			<li><i class="fas fa-coffee"></i>Collect the coffee set furniture</li>
		</ul>
</section>
<section class="section-content" id="learnmore">
	<iframe id="video" src="https://www.youtube.com/embed/9KAFTh5zqF4" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
	<form action="https://www.freecodecamp.com/email-submit" id="form">
		<label for="email-label">Enter your email to receive updates on our products: </label>
		<input type="email" id="email" name="email" placeholder="Enter your email here">
		<input type="submit" id="submit"></input>
	</form>
</section>
<section class="section-content" id="product-range">
	<div class="product">
		<h2>Gracie</h2>
		<img class="card-image" alt="Animal Crossing Character: Gracie" src="https://vignette.wikia.nocookie.net/animalcrossing/images/c/cb/Gracie_NL.png/revision/latest?cb=20140708164607">
		<ul>
			<li>Coffee Beans: Blend</li>
			<li>Milk: None at all</li>
			<li>Sugar: None at all</li>
		</ul>
		<button class="choicebutton">Learn more</button>
	</div>
	<div class="product">
		<h2>Isabelle</h2>
		<img class="card-image" alt="Animal Crossing Character: Isabelle" src="https://vignette.wikia.nocookie.net/mariokart/images/2/22/IsabelleAssist.png/revision/latest?cb=20170727050218">
		<ul>
			<li>Coffee Beans: Mocha</li>
			<li>Milk: Lots</li>
			<li>Sugar: Three Spoonfuls</li>
		</ul>
		<button class="choicebutton">Learn more</button>
	</div>
	<div class="product">
		<h2>Phineas</h2>
		<img class="card-image" alt="Animal Crossing Character: Phineas" src="https://vignette.wikia.nocookie.net/animalcrossing/images/a/a1/Transparent_Phineas.png/revision/latest?cb=20141230194508">
		<ul>
			<li>Coffee Beans: Kilimanjaro</li>
			<li>Milk: Lots</li>
			<li>Sugar: Three Spoonfuls</li>
		</ul>
		<button class="choicebutton">Learn more</button>
	</div>
</section>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
}

html, body {
 height: 100%;
 width: 100%;
 font-size: 100%;
 margin: 0;
}

body {
	font-family: 'Alegreya Sans', sans-serif;
	--green: #87D37C;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  margin: auto;
  width: 100%;
}

.navbar {
	display: flex;
	height: 3.125em;
	align-items: center;
  	padding: 0 10px;
  	background-color: var(--green);
  	font-size: 1.125em;
  	list-style: none;
	font-family: 'Alegreya', serif;
}

@media (max-width: 650px) {
	.navbar {
		display: row;
		font-size: 1em;
		justify-content: space-around;
	}

	#businessname {
		display: none;
	}

  #form input, button {
  	margin: 0 auto;
  	margin-top: 4%;
  }
}

@media (min-width: 650px) {
	.product {
		width: 26%;
	}
}

.navbar li {
	padding: 0.4em;
}

.navbar li a {
	text-decoration: none;
	color: black;
}

#businessname {
	margin: 0 auto;
}

#header-img {
	width: 2.81em;
}

.section-content {
	display: flex;
	justify-content: center;
 	align-items: center;
 	flex-wrap: wrap;
 	height: 100vh;
}

#main {
	background-image: url("https://images.unsplash.com/photo-1509785307050-d4066910ec1e?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=3c043b7f518066a42a3dc0cafea56253&auto=format&fit=crop&w=1228&q=80");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	text-align: center;
}

h1 {
	color: white;
	font-size: 3.125em;
	width: 60%;
	margin: 0 auto;
	border: 5px solid rgba(255,255,255, 0.45);
	padding: 1em 0.8em;
}

#features {
	font-size: 1.3em;
}

#features ul li {
	padding: 0.6em;
	list-style: none;
}

.fa-coffee {
	margin-right: 1em;
}

#learnmore {
	justify-content: space-around;
}

#spacing {
	height: 1em;
}

#video {
	border: 5px solid black;
	border-radius: 10px;
	width: 560px;
	height: 350px;
}

#form {
	display: flex;
	justify-content: space-around;
	flex-wrap: wrap;
	flex-direction: column;
	font-size: 1em;
}

#email {
	width: 20em;
	border-radius: 2px;
	padding: 0.3em;
	margin-top: 0.9em;
}

button, #submit {
	padding: 0.9em;
	border-radius: 5px;
	border: 2px solid var(--green);
	width: 20%;
	margin-top: 1em;
	transition: all 0.3s ease 0s;
	cursor: pointer;
}

button:hover {
	background-color: var(--green);
	color: white;
}

#submit:hover {
	background-color: var(--green);
	color: white;
}

#product-range {
	margin: 0 auto;
	width: 80%;
  	justify-content: space-around;
}

.product {
	padding: 1.875em;
	border: 1px solid var(--green);
	text-align: center;
	background-color: white;
}

#product-range button {
	width: 80%;
}

#product-range ul {
	text-align: left;
	margin-left: 30%;
}

.card-image {
	width: 10.2em;
	height: 12em;
	margin: 0 auto;
}
              
            
!

JS

              
                
              
            
!
999px

Console