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

              
                <!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>FCC - Product Landing Page</title>
  <link href="main.css" type="text/css" rel="stylesheet">
  <link href="https://fonts.googleapis.com/css?family=Lato:300,300i,400,400i,700,700i,900,900i|Open+Sans:300,300i,400,400i,600,600i,700,700i" rel="stylesheet">
</head>

<!--All id tags are used for FCC project specs only. BEM naming conventions used for CSS styling.-->

<body>
  <div class="container">
    <header class="header flex-container" id="header">
      <img src="https://lh3.googleusercontent.com/pcQ7gNw0vFrJsgfYbRzeUjR5YQMKQVL40ipTO8rlFtW0uIZvBEdqzV0I13L6M9zNXKh1VTmuHfmkFJVDltePoeNArKtFu2xCpxXaTXp5BU4tZ3H10Odm-v8KDZvdUHLPULIPpAw6bzLoMmhBvnl_v_KCRYQkZp8h6hb9zkUANk3U8SzDOyViJB5P9_zwSj93lxImykA31NgiNNl00coBnljXWyU5AqRwaPD2iAkQZtt5KBgm0IgkhQS0gJy4WJ3j0KaMxe7rHVVlFd8LflwB7wrDFr87hCbBrmJuct6QEB-M-5z0anyhvAJfddWTolk8S5712QnZIoLxp6jfS-VF0F2N5NLimfT2n-8C3atrhMVxN_JMTT_blI9PzSxiIhdwqlErOM3Z_04JA3-YhacgJQTBgc8lNucgCXXb2gn8YBYqSri9py5tpe_uOCsqe4rXVvzJw3dsLkKfAPcfnIOJLh4gsh74Rfc1Xbu16v0RpyR1-hXQaAeLEW0n-shGZuy0sF3WYcjT-wp1vGyhqtXvqsGp3sab6ar1KL4Q5wQDKsJbOKo7mgFKcvbb5RyIC8rUENnNdi8UC_W97hnmghWsNLJaTF-M_9TtCkfcgz--QtaVN98i1hJ4THB0eZV9DVpIFOnQkS-bg0suIhOo6c8lYbceFkfFOVtH=w300-h125-no" alt="" class="header__img" id="header-img">
      <nav class="nav" id="nav-bar">
        <ul class="nav__list">
          <!--Break BEM naming conventions here due to FCC project specs.-->
          <li><a href="#article" class="nav-link">Featured</a></li>
          <li><a href="#product-dating" class="nav-link">Food Dating</a></li>
          <li><a href="#purchasing" class="nav-link">Newsletter</a></li>
        </ul>
      </nav>
    </header>

    <main class="main flex-container">
      <article id="article" class="article flex-container">
        <div class="featured-item flex-container">
          <img src="https://lh3.googleusercontent.com/RLUmIbCJOSm45U6yjeKTeq-VDGuhtDTQHUfIVT4aGIBWioip1WMrbf-vW6Mj4aawDQyba1fiDs4ACqDwOa35P6nuBYFwR50EoWvjL0b0vqwd0_s8FU39xYmNQeWngx7vUQqkXSzjWam-bSeaMi2d6NOU9h8g8fgm5htBi7VfN345JVE_RkVgnHuFMPccqWPO4HzYjDDA8UXEUzjq27Wru8OnlmAbkQMhUHKv--36yf8N4zF6mZbKmCU_jwadYvajXAqZh7byBoJNtQn_DnGODeNlVk5EZOpCxcN0HBz85YhEtza8R_zmJ_evdXumBqSScgUdAQSw07m4EH9wu9iURGgAu2s_AZDGccXRek0KghrgSE1DX0HInSptPo6cRWeqKMFpPe_lBJ9n-5QEhuDDBOrCQGjpO7aeoG9hxq9PmiJpz0RYBqRO8mkXvGP4uZobATE7GYgYs-IOqMwebXq6dvazNNPVxN-Qko4-ww1wD2y1Maz3SvI7JvY2jaVzu3i366fslDBnC01Lu6Kj_Glbvap4SI09KNJNr_xkl15qO9c86tZxrgSbcsEwi8uyUFegBkLyCt3M_5nVahM1krAhpRNqd1o_BUgvJiqdwaeqjGKcM6wNlHD-7eUWucC12VQurlaBqYqucQsBEPMUTNLIfvXPAkyb9C8t=s600-no" alt="Lunchable Pizza Snack" class="featured-item__img">
          <div class="featured-item__about flex-container">
            <h2 class="featured-item__name">Oscar Mayer Lunchables Pepperoni Pizza, 4.3 oz Tray</h2>
            <span class="featured-item__price">$0.79 /each</span>
            <span class="featured-item__price">$5.00 /case</span>
            <h3 class="featured-item__description-header">Product Information</h3>
            <p class="featured-item__description">A classic for a reason, the Oscar Mayer Pepperoni Pizza is carefully
              packed in a convenient box. The crust is delicately prepared with whole grain, and the pizza includes
              only premium quality pork, chicken and beef used to make the succulent pepperoni.</p>
            <hr>
          </div>
        </div>
        <div class="featured-item flex-container">
          <img src="https://lh3.googleusercontent.com/rpLJy__n8YhiIlLUAKy_JPJlEPgASEFTYnjE-V7JOPPZrAp0n3lZz39vfZYQvyzMS9TTaS0RSsNIz_clcy8cVqX2KhIDB6AbOb6dnU31dnpHsvbdyDZafRt85cAIyfiLawKs74S-kNZREA4vxhH3hw4POwUhgaHL3AHJc7Fq7fFXWIzYnDqvif0OShro2NVoGcTQBc56h0wSGwcL4AwLDwcvcYk778Fvm1qXnn6HFwBlAMdxeuz_0XpxA4__cyLXUtMeNDM12ApVFzJ7yNdidJJs-sdjwO5l4GOX4jX9UvEKD1Qsj3DWNYRT0j5oq7VzKeAbMxCvJOytWwrUKIo97q9bOH52Svbm3jQcDiegwrCh4UaX0u8Kglffy0tcCc4zOEJP2XmeQO6tHUcCBpSNzWuCHH2yH6JXv1fl6BmYLgrW2fKpMXnSQQbp0MMb6cti-F4BB5K_8ebUIsSpG-SBw0yNn9m1ghn8E4RtZti_JaGJ18FJ1Qq99iwXhhgGcdncXYDehaq6pkP1EdEMmQlXtvgvY6AeDIQBCmrjfjS1jDJrhExlOnpGxnRb_bwggn5BR-2vsJQ0hhdA1f71uy27GrLrXBKRBhjMm4WUoC9M80rq3YjqMhu7MM0cgJC04JrarVE0-3nHL_dhAh2okduZcLT8IjyuMz5U=w600-h370-no" alt="Hardwood Smoked Bacon" class="featured-item__img">
          <div class="featured-item__about flex-container">
            <h2 class="featured-item__name">Oscar Mayer Naturally Hardwood Smoked Bacon, <br>16 oz Vacuum Pack</h2>
            <span class="featured-item__price">$2.99 /each</span>
            <h3 class="featured-item__description-header">Product Information</h3>
            <p class="featured-item__description">At OSCAR MAYER, we believe you deserve the best. In fact, it’s one of the original principles we were founded on. Since our humble beginning more than a century ago, we’ve used the yellow band to signify our promise of the quality we put into everything we make.</p>
            <hr>
          </div>
        </div>

        <div class="featured-item flex-container">
          <img src="https://lh3.googleusercontent.com/ALEwwN4NoO8H8rSQ1JVs_f6CmSfvtV0bcVHcgSlOaRZryhaMc6Dc61pyDFD-slEQoFErjMFIuDCTgaZFFgtOCEz2W3TxmBOy_3gdi0LZPtjMG4NLzQux5fGzbIoGBjklGJDsJSLdyIA0TmZOisNqpRhkg1IpoOrWAO3yQ0sdwEdlpSRf7E1CstvayTIA6wCNhW9RKO1N-7anWFDkayqRpNdJWnXR_pNqV3HTtG57biZYXPuLqLGtuEIdWWK3nuTVyW2_guPpsAAEmeNBOlRj8wHnfRIj5AoNh4MQOjXlQ3Jhzm__9B2SUK7l--0RAwDQqx9ICwmuk-91_-oV1Goh_r4ObQJkLE6KVvs5WkKbBmaOvbCkWFggxW7SAdrXkRsatkYPUUjTB2FaLa_3YxY-5bImDypqmR5A_5KX6hbeikfFZwzz0H9UhwrCquY62Ar7P6iIHbvpM8Km7SY2LiX02C9owdahPGG_L4jQHKZ-bJJSKv6mGXO8Ax83Qh8fN4gSHPqmaCHsV-K_swTJHdwzIb8OL18-5o3YINmgCnFLozyawTo3nlx4cr-obk5xCgRPTzQaRVw7Cd1CsF7z0boz9mpffn_c7Rd5FdG_Ay5-dThBC7a7DBTndchn3-FQSeKSVQRZZ4KekrDQZrKxGh-hGyZUzCfWNBot=s600-no" alt="Barbeque Chicken Pizza" class="featured-item__img">
          <div class="featured-item__about flex-container">
            <h2 class="featured-item__name">California Pizza Kitchen Crispy Thin Crust BBQ Recipe Chicken Pizza, 14.7 oz</h2>
            <span class="featured-item__price">$3.99 /each</span>
            <h3 class="featured-item__description-header">Product Information</h3>
            <p class="featured-item__description">This bite is bursting with zesty, sweet and tangy flavors. Our BBQ Recipe Chicken pizza has large pieces of succulent, seasoned white-meat chicken, zesty red onion, and smoked Gouda on our Crispy Thin Crust.</p>
            <hr>
          </div>
        </div>
      </article>

      <section id="product-dating" class="product-dating flex-container">
        <div class="product-dating__header">
          <h1 class="product-dating__header-title">Common Myths About Product Dating</h1>
        </div>
        <video class="closing__video" src="https://app.coverr.co/s3/mp4/Scrolling-iPhone-XR.mp4" id="video" controls>
          <span>Video Error: Not Displayed<span>
        </video>
      </section>
      <hr>
      <section id="purchasing" class="purchasing flex-container">
        <h1 class="purchasing__header-title">Subscribe to Weekly Deals!</h1>
        <form id="form" class="purchasing__newsletter-form" action="https://www.freecodecamp.com/email-submit">
          <label for="email">Email: 
            <input name="email" id="email" type="email" placeholder="Enter Contact Email">
          </label>
          <input id="submit" type="submit" value="Submit">
        </form>
      </section>

    </main>
  </div>
</body>

</html>
              
            
!

CSS

              
                /* CSS Variables */
:root {
  --main-bg-color: rgb(255, 255, 255);
  --secondary-bg-color: hsl(226, 100%, 67%);

  --button-bg-color: hsl(211, 100%, 50%);
  --button-bg-hover: hsl(211, 100%, 58%);
  --button-color: hsl(0, 0%, 100%);
  --button-shadow: 1px 1px 2px 0 hsl(0, 0%, 0%);

  --main-title-font: 'Lato', sans-serif;
  --main-body-font: 'Open Sans', sans-serif;

  --header-font-color: hsl(204, 100%, 50%);
  --description-font-color: hsl(0, 0%, 25%);
}

/* Universal Page Styles */
* {
  font-size: 100%;
  font-family: var(--main-body-font);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

hr {
  margin: 20px;
  background-color: hsl(0, 0%, 80%);
  border: none;
  height: 1px;
}

/* Blocks */
.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem .75rem;
  background-color: var(--main-bg-color);
}

.flex-container {
  display: flex;
  flex-direction: column;
}

.header {
  height: auto;
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1rem 0;
  background-color: var(--main-bg-color);
}

.nav {
  width: 21rem;
}

.main {
  width: 100%;
  margin-top: 200px;
  margin-bottom: 20px;
}

/* Elements */
.header__img {
  width: 15rem;
  height: 100%;
  margin: 0 auto;
}

.nav__list {
  text-decoration: none;
  list-style: none;
  display: flex;
  justify-content: space-around;
  margin: 1.5rem 0;
}

.nav-link {
  text-decoration: none;
  font-weight: 700;
  color: var(--button-color);
  background-color: var(--button-bg-color);
  padding: 0.5rem;
  border-radius: 10px;
}

.featured-item {
  flex-direction: row;
  flex-wrap: wrap;
}

.featured-item__img {
  width: 100%;
  max-width: 20rem;
  margin-bottom: 10px;
  object-fit: contain;
}

.featured-item__name {
  font-family: var(--main-title-font);
  font-size: 1.6rem;
  font-weight: 300;
  margin-bottom: 5px;
}

.featured-item__description-header {
  font-family: var(--main-title-font);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--header-font-color);
  margin-top: 20px;
}

.featured-item__price {
  font-size: 1.2rem;
  font-weight: 600;
}

.featured-item__description {
  font-size: .9rem;
  color: var(--description-font-color);
  text-align: justify;
  margin-top: 5px;
}

.product-dating__header-title {
  font-family: var(--main-title-font);
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 20px;
  text-align: center;
}

.closing__video {
  width: 100%;
  max-width: 30rem;
  display: block;
  margin: 0 auto;
}

.purchasing {
  background-color: var(--secondary-bg-color);
  padding: 1rem;
  margin: 0 auto;
  border-radius: 1rem;
  justify-content: space-around;
}

.purchasing__header-title {
  font-family: var(--main-title-font);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom:10px;
  width: 100%;
  text-align: center;
}

.purchasing__newsletter-form {
  text-align: center;
}

/* Modifiers */
.nav-link:active,
.nav-link:hover {
  background-color: var(--button-bg-hover);
}

/* Media Queries */
@media (min-width: 480px) {
  .flex-container {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .header {
    align-items: center;
    height: auto;
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 980px;
    background-color: var(--main-bg-color);
    padding: 1rem .75rem;
  }

  .header__img {
    margin: 0;
  }
  
  .nav {
    margin-left: auto;
  }

  .main {
    margin-top: 120px;
    padding: 1rem 2rem;
  }

  .featured-item__img {
    width: 35%;
  }

  .featured-item__about {
    width: 60%;
    margin-left: 1rem;
    flex-direction: column;
  }

  .product-dating {
    margin: 1rem auto 3rem auto;
    justify-content: space-around;
  }
}
              
            
!

JS

              
                // coded by @atjonathan
const projectName = 'product-landing-page';
localStorage.setItem('example_project', 'Product Landing Page');
// REPLACE CDN WITH GITCDN!!!

              
            
!
999px

Console