Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                <!DOCTYPE html>
<hmtl lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content="freeCodeCamp product landing page project" />
    <link rel="stylesheet" type="text/css" href="./styles.css" />
    <link
      rel="stylesheet"
      href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
      integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf"
      crossorigin="anonymous"
    />
    <title>Product Landing Page</title>
  </head>
  <body>
    <header id="header">
      <div class="logo">
        <img id="header-img" src="https://cdn-icons-png.flaticon.com/512/1071/1071138.png?w=900&t=st=1655138575~exp=1655139175~hmac=40b7dac2a7be07435ac4fd1ea05c5bd4d7bbf094b45cc72a0aebfad7957ad0ba" alt="stroopwafel drawing"/>
        <h1>Original Stroopwafels</h1>
      </div>
      <nav id="nav-bar">
        <ul>
          <li><a class="nav-link" href="#About">About</a></li>
          <li><a class="nav-link" href="#How_to_eat">How to eat</a></li>
          <li><a class="nav-link" href="#Pricing">Pricing</a></li
        </ul>
      </nav>
    </header>
    <main>
      <section id="hero">
        <h2>Handcrafted, Dutch cookies</h2>
        <p>Made <span class="orange">fresh</span> daily
        <!-- Replace action with actual website server -->
        <form id="form" action="https://www.freecodecamp.com/email-submit" method="get">
          <input id="email" type="email" name="email" placeholder="Enter your email address" required></input>
          <input id="submit" type="submit" value="GET SPECIAL OFFERS" /> 
        </form>
      </section>
      <section id="About">
        <div class="img-txt">
          <i class="icon fa fa-stroopwafel"></i>
          <div class="txt">
            <h2>Dutch Tradition</h2>
            <p>A stroopwafel (Dutch pronunciation: [ˈstroːpˌʋaːfəl]; literally 'syrup waffle') is a thin, round waffle cookie made from two layers of sweet baked dough held together by caramel filling. According to Dutch culinary folklore, stroopwafels were first made in Gouda either during the late 18th century or the early 19th century by bakers repurposing scraps and crumbs by sweetening them with syrup. Stroopwafels were not found outside Gouda until 1870, by which point the city was home to around 100 syrup-waffle bakers. Today, stroopwafels are a well-known Dutch treat popular throughout the Netherlands and the former Dutch Empire, and exported abroad.
             </p>
          </div>
        </div>
        <div class="img-txt">
          <i class="icon fa fa-fire"></i>
          <div class="txt">
            <h2>Classic Flavor</h2>
            <p>We make our stroopwafels from simple ingredients, the traditional way. Stiff dough of flour, butter, brown sugar, yeast, milk, and eggs is pressed in a hot waffle iron until crisped. While still warm, the waffles are shaped into a circle with a cookie cutter and pulled apart into top and bottom wafers. At last, a warm caramel filling made from syrup, brown sugar, butter, and cinnamon is spread between the wafers, then the waffle is reassembled.</p>
          </div>
        </div>
        <div class="img-txt">
          <i class="icon fa fa-truck"></i>
          <div class="txt">
            <h2>Available Today</h2>
            <p>Our stroopwafel are made to order and delivered same-day within the greater city metropolitan area. Get them even faster by stopping by our cart in the park!</p>
          </div>
        <div>
      </section>
      <section id="How_to_eat">
        <div class="video-container">
          <iframe id="video" src="https://www.youtube.com/embed/zBBK8O8vF0k" 
  height="225"
  width="400"
  title="YouTube video player" frameborder="0" allow="accelerometer; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
          </iframe>
        </div>
      </section>
      <!-- Add JS to save selections in cart for checkout -->
      <section id="Pricing">
        <div class="pricing-container">
          <div class="product" id="classic">
            <h2>Classic Caramel (6-pack)</h2>
            <h3>$4.99</h3>
            <div class="select-wrapper">
              <select id="dropdown" name="classic-order">
                <option value="">Choose a quantity</option>
                <option value="1">1 pack</option>
                <option value="3">3 packs</option>
                <option value="6">6 packs</option>
                <option value="9">9 packs</option>
                <option value="12">12 packs</option>
              </select>
            </div>
          </div>
          <div class="product" id="honey">
            <h2>Honey-filled (6-pack)</h2>
            <h3>$4.99</h3>
            <div class="select-wrapper">
              <select id="dropdown" name="honey-order">
                <option value="">Choose a quantity</option>
                <option value="1">1 pack</option>
                <option value="3">3 packs</option>
                <option value="6">6 packs</option>
                <option value="9">9 packs</option>
                <option value="12">12 packs</option>
              </select>
            </div>
          </div>
          <div class="product" id="chocolate">
            <h2>Chocolate-dipped (6-pack)</h2>
            <h3>$5.99</h3>
            <div class="select-wrapper">
              <select id="dropdown" name="chocolate-order">
                <option value="">Choose a quantity</option>
                <option value="1">1 pack</option>
                <option value="3">3 packs</option>
                <option value="6">6 packs</option>
                <option value="9">9 packs</option>
                <option value="12">12 packs</option>
              </select>
            </div>
          </div>
        </div>
        <input id="order" type="button" value="GO TO CHECKOUT" /> 
      </section>
    </main>
    <!-- Add hyperlinks to footer -->
    <footer>
      <ul>
          <li><a class="foot-link" href="#">Contact</a></li>
          <li><a class="foot-link" href="#">Privacy</a></li>
          <li><a class="foot-link" href="#">Terms</a></li
      <div>
      </div>
      </ul>
       <!-- Replace with copyright information -->
      <p>Copyright 2022, Original Stroopwafels</p>
    </footer>
  </body>
</html>
              
            
!

CSS

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

body {
  font-family: sans-serif;
}

header {
  display: flex;
  flex-direction: row;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  min-height: 70px;
  width: 100%;
  justify-content: space-between;
  gap: 10%;
  padding: 20px 20px 20px 5%;
  background: white;
  color: #A91F32;
  z-index: 9999;
}

.logo {
  display: flex;
  width: 250px;
  height: 70px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}

h1 {
  text-align: center;
  font-family: helvetica;
}

.logo img {
  max-height: 70px;
  max-width: auto;
}

#nav-bar {
  width: 100%;
  max-width: 30rem; 
  font-size: 1.2rem;
}

li {
  list-style: none;
}

.nav-link {
  text-decoration: none;
  color: #1E4785;
  font-weight: bold;
  padding: 5px;
  border-radius: 5px;
}

.nav-link:hover {
  background: #A91F32;
}

nav > ul {
  width: 100%;
  display: flex;
  flex-direction: row;
  height: 1.5rem;
  justify-content: space-around;
}

@media (max-width: 650px) {
  header {
    flex-direction: column;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
  }
  nav {
    margin-top: 10px;
  }
}

main {
  position: relative;
  padding: 20px;
}

.orange {
  font-style: italic;
  color: #A91F32;
  font-weight: 600;
}

#hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 200px;
  margin-top: 90px;
  background: #1E4785;
  color: white;
}

#hero > h2 {
  word-wrap: break-word;
}

#hero > p {
  font-size: 1.2rem;
  margin-bottom: 20px;
  margin-top: 5px;
}

#hero input[type='email'] {
  max-width: 275px;
  width: 100%;
  padding: 3px 8px;
  font-size: .9rem;
}

#hero input[type='submit'] {
  max-width: 200px;
  width: 100%;
  height: 30px;
  margin: 15px 15px 5px 15px;
  border: 0;
  background-color: #A91F32;
  color: white;
  font-weight: 600;
  padding: 5px;
  border-radius: 5px;
}

#hero input[type='submit']:hover {
  color: #1E4785;
  transition: color 1s;
  cursor: pointer;
}

@media (max-width: 650px) {
  #hero {
    margin-top: 100px;
  }
}

.img-txt {
  display: flex;
}

.icon {
  color: #A91F32;
}

section {
  margin: 40px auto 0 auto;
}

i {
  font-size: 3rem;
  padding-top: 4px;
  min-width: 5rem;
  max-width: 5rem;
  text-align: center;
}

.img-txt {
  display: flex;
  color: black;
  margin-bottom: 1.5rem;
  justify-content: start;
}

.txt {
  padding-left: 1rem;
}

.txt h2 {
  color: #1E4785;
  margin-bottom: .3rem;
}

@media (max-width: 550px) {
  main {
    padding-left: 0;
    padding-right: 0;
  }
  #About {
    margin-top: 0;
  }
  .img-txt .icon {
    display: none;
  }
  .img-txt {
    margin: 0;
  }
  .txt {
    text-align: center;
    padding: 0 1rem;
  }
  .txt h2 {
    margin-bottom: 0;
  }
}

#How_to_eat {
  max-height: 480px;
  overflow: hidden;
}

.video-container {
  padding-bottom: 56.25%; 
  padding-top: 35px;
  height: 0;
  position: relative;
  overflow: hidden;
  max-height: 480px;
  max-width: 854px;
  margin-left: auto; 
  margin-right: auto; 
} 

.video-container iframe {
  position: absolute;
  top: 0; 
  border: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  max-height: 480px;
}


@media (max-width: 850px) {
  #Pricing {
    margin-top: 35px;
  }
}

.product {
  align-items: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  margin: 20px;
  width: calc(100%/3);
  height: 200px;
  max-width: 400px;
  border: 1px solid black;
}

.product h2, .product h3, .select-wrapper {
  height: calc(200px/3);
  width: 100%;
  line-height: calc(200px/3);
  padding: 0 1rem;
}

.pricing-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.product h2 {
  background: #A91F32;
  font-size: 1.1rem;
  color: white;
  overflow: hidden;
}

.select-wrapper {
  background: #1E4785;
  color: white;
}

.product select {
  margin-top: 10px;
  max-width: 100%
}

#order {
  max-width: 200px;
  width: 100%;
  height: 30px;
  display: block;
  margin: 0 auto;
  border: 0;
  background-color: #A91F32;
  color: white;
  font-weight: 600;
  padding: 5px;
  border-radius: 5px;
}

#order:hover {
  background: #1E4785;
  transition: background 1s;
  cursor: pointer;
}

@media (max-width: 750px) {
  .pricing-container {
    flex-direction: column;
  }
  .product {
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
    margin-bottom: 10px;
    height: 150px;
  }
  .product h2, .product h3, .select-wrapper {
  height: calc(150px/3);
  width: 100%;
  line-height: calc(150px/3);
  padding: 0 1rem;
  }
}

footer {
  background: #1E4785;
  margin: 100px 20px 0 20px;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  text-align: right;
}

.foot-link {
  text-decoration: none;
  color: white;
  font-weight: bold;
}

footer ul {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

footer li {
  padding: 0 1rem;
}

/* hack way to fix nav link offset */
section::before { 
  display: block; 
  content: " "; 
  margin-top: -150px; 
  height: 150px; 
  visibility: hidden; 
  pointer-events: none;
} 
              
            
!

JS

              
                
              
            
!
999px

Console