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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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">
  <header id="header">
  <nav id="nav-bar">
    <div class="image"><!--divs to keep each section in grid cell-->
      <img id="header-img" src="https://s3.amazonaws.com/freecodecamp/original_trombones.png" alt="logo"><!--U.S.2-->
    </div>
    <div class="links"><!--divs to keep each section in grid cell-->
      <ul>
        <li><a class="nav-link" href="#features">Features</a></li><!--U.S.4, 5-->
        <li><a class="nav-link" href="#video">Video</a></li><!--U.S.4, 5-->
        <li><a class="nav-link" href="#pricing">Pricing</a></li><!--U.S.4, 5-->
      </ul>
    </div>
  </nav>
</header>
    <main>
      <h1>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</h1>
      <form id="form" action="https://www.freecodecamp.com/email-submit"><!--U.S.7, 12-->
        <label for="email"></label>
        <input type="email" id="email" name="email" placeholder="Enter your Email address" required><!--U.S.9, 10-->
        <input type="submit" value="Get Started" name="submit" id="submit"><!--U.S.9, 11, 12-->
      </form>
      <div id="features">
        <h3>Lorem ipsum</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</p>
        <h3>Lorem ipsum</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</p>
        <h3>Lorem ipsum</h3>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat</p>
      </div><!--U.S.5-->
      <div id="videobit"><!--U.S.5-->
        <p>Check-out how it works</p>
        <iframe id="video" width="560" height="315" src="https://www.youtube.com/embed/CmzKQ3PSrow" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><!--U.S.6-->
      </div>
      <div id="pricing">
        <div id="product">
          <h2>Tier 1</h2>
          <h3>500€</h3>
          <ul>
            <li>Lorem</li>
            <li>Ipsum</li>
            <li>Dolor sit amet</li>
          </ul>
          <button class="btn">Select</button>
        </div>
        <div id="product">
          <h2>Tier 2</h2>
          <h3>1000€</h3>
          <ul>
            <li>Lorem</li>
            <li>Ipsum</li>
            <li>Dolor sit amet</li>
          </ul>
          <button class="btn">Select</button>
        </div>
        <div id="productspc">
          <h2>Tier 3</h2>
          <h3>1299€</h3>
          <ul>
            <li>Lorem</li>
            <li>Ipsum</li>
            <li>Dolor sit amet</li>
          </ul>
          <button class="btnspc">Select</button>
        </div>
      </div><!--U.S.5-->
    </main>
    <footer>
       <p>Copyrights to whomever they are due</p>  
    </footer>
  </body>
</html>
<!--Missing U.S. 14-->
              
            
!

CSS

              
                /*Import Font*/
@import "https://fonts.googleapis.com/css?family=Lato:400,700";
/*GENERAL FORMATTING*/
body{
  background-color: #eee;
  font-family: 'Lato', sans-serif;
}
main{
  text-align: center;
}
footer{
  background-color: #ddd;
  width: 70%;
  margin: auto;
  text-align: right;
  padding: 15px 5px 5px 0px;
}
/*HEADER IMMOVABLE NAVBAR*/
/*U.S.1*/
header{
  margin-bottom: 100px;/*spacing*/
  background-color: #eee;
}
/*U.S.3*/
#nav-bar{
  display: grid;/*invoke css grid*/
  grid-template-columns: 50% 50%;/*two equal columns*/
  position: fixed;/*makes navbar permanent on top*/ /*U.S.13*/
  padding: 10px;
  top: 0;/*makes navbar permanent on top*/ /*U.S.13*/
  left: 0;
  width: 100%;/*makes navbar permanent on top*/
  background-color: #eee;/*makes navbar solid*/
}
/*U.S.2*/
#header-img{
  object-fit: cover;/*fits image to cell*/
  width: 70%;/*70% of the cell*/
  max-height: 100%;/*height of cell*/
  float: left;/*align left*/
}
ul li{
  display: inline;/*makes links horizontal*/
  float: right;/*align right*/
}
.nav-link{
  padding: 50px;/*spacing between links*/
}
a {
  color: #000;
  text-decoration: none;
}
/*EMAIL AND SUBMIT FEATURE*/
/*U.S.7*/
main h1{
  font-size: medium;
  width: 50%;/*spacing*/
  margin: auto;/*centers text*/
  margin-top: 50px;
}
#form{
  display: flex;
  flex-direction: column;
}
#form input[type="email"]{
  width: 50%;
  margin: 40px auto 0px auto;
  padding: 10px;
  font-family: 'Lato', sans-serif;
}
#form input[type="submit"]{
  width: 20%;
  margin: 40px auto 0px auto;
}
#submit{
  padding:  0 20px;
  height: 40px;
  font-size: 1em;
  font-weight: 900;
  text-transform: uppercase;
  border: 3px black solid;
  border-radius: 2px;
  background: #f1c40f;
  cursor: pointer;
  margin-top: 0px;
}
#submit:hover{
  transform: scale(1.1);
}
/*SECTION 1, PENDING LITTLE ICONS*/
#features{
  width: 70%;/*spacing*/
  margin: auto; /*centers*/
  margin-top: 50px;/*spacing*/
  margin-bottom: 50px;/*spacing*/
  text-align: left;
  display: flex;/*invoke flexbox*/
  flex-direction: column;/*stack one on tope of other*/
  justify-content: center;/*center along horizontal axis*/
  background-color: white;
  border-radius: 10px;
}
#features h3{
  padding-left: 10px;
  margin-bottom: 0;
}
#features p{
  margin-top: 0px;
  padding-left: 10px;
}
/*PRICING SECTION*/
/*general backdrop for all three boxes*/
#pricing{
  display: flex;/*invoke flex*/
  justify-content: space-around;/*spacing equally*/
  padding: 5px;
  width: 70%;/*screen width*/
  margin: auto;/*center*/
  margin-top: 50px;/*spacing*/
  background-color: white;
  border-radius: 10px;
  width: 70%;/*screen width*/
}
/*Each individual box*/
#product{
  border: 1px black solid;
  margin-bottom: 5px;
  display: flex;/*invoke flex*/
  flex-direction: column;/*stack one on top of the other*/
  align-items: center;/*center vertically*/
  margin-top: 10px;
}
/*lists within boxes*/
#product ul{
  list-style-type: none;/*removes bullet points*/
  margin: 0;/*removes default styles*/
  padding: 0px 90px 0px 90px;/*removes default styles + spacing*/
  margin-bottom: 5px;/*spacing*/
}
/*heading of each box*/
#product h2{
  background-color: grey;
  margin: 0px;
  width: 100%;
  padding-bottom: 10px;
  padding-top: 10px;
}
/*BUTTONS*/
.btn{
  padding: 0 20px;
  height: 40px;
  font-size: 1em;
  font-weight: 900;
  text-transform: uppercase;
  border: 3px black solid;
  border-radius: 2px;
  background: #f1c40f;
  cursor: pointer;
  margin: 10px;
}
.btn:hover{
  transform: scale(1.1);
}
/*BEST VALUE FOR MONEY ALERT*/
.btnspc{
  padding: 0 20px;
  height: 40px;
  font-size: 1em;
  font-weight: 900;
  text-transform: uppercase;
  border: 3px black solid;
  border-radius: 2px;
  background: #f1c40f;
  cursor: pointer;
  margin: 10px;
}
.btnspc:hover{
  transform: scale(1.1);
}
#productspc{
  border: 1px black solid;
  margin-bottom: 5px;
  display: flex;/*invoke flex*/
  flex-direction: column;/*stack one on top of the other*/
  align-items: center;/*center vertically*/
  margin-top: 10px;
}
#productspc ul{
  list-style-type: none;/*removes bullet points*/
  margin: 0;/*removes default styles*/
  padding: 0px 90px 0px 90px;/*removes default styles + spacing*/
  margin-bottom: 5px;/*spacing*/
}
#productspc h2{
  background-color: grey;
  margin: 0px;
  width: 100%;
  padding-bottom: 10px;
  padding-top: 10px;
}

#productspc:hover{
  transform: scale(1.2);
}
#productspc:hover h2{
  background-color:red;
}
/*FOOTER*/
footer p{
  margin-bottom: 0;/*deliminates default margin*/
  font-size: small;
}
/*ADAPTING TO MOBILE*/
@media (max-width: 700px){
  /*makes video responsive*/
  #video{/*makes video responsive*/
  display: block;/*User Story 8, makes image responsive*/
  max-width: 100%; /*User Story 8, makes image responsive*/
  height: auto; /*User Story 8, makes image responsive*/
  margin: auto;/*User Story 9, makes image responsive*/
  }
  /*makes pricing into columns*/
  #pricing{
  display: flex;/*invoke flex*/
  align-items: center;/*spacing equally*/
  flex-direction: column;
  padding: 5px;
  width: 70%;/*screen width*/
  margin: auto;/*center*/
  margin-top: 50px;/*spacing*/
  background-color: white;
  border-radius: 10px;
  width: 70%;/*screen width*/
  }
}
/*adapts email field and button*/
@media (max-width: 890px){
  #form input[type="email"]{
  width: 80%;
  margin: 40px auto 0px auto;
  padding: 10px;
  font-family: 'Lato', sans-serif;
}
#form input[type="submit"]{
  width: 80%;
  margin: 40px auto 0px auto;
}
}
/*adapts header*/
@media (max-width: 1001px){
  header{
  background-color: #eee;
  }
      /*U.S.3*/
      #nav-bar{
        display: grid;/*invoke css grid*/
        grid-template-columns: none;/*removes original columns*/
        grid-template-rows: auto auto;/*adds two rows*/
        position: fixed;/*makes navbar permanent on top*/ /*U.S.13*/
        padding: 0px;/*spacing*/
        top: 0;/*makes navbar permanent on top*/ /*U.S.13*/
        width: 100%;/*makes navbar permanent on top*/
        background-color: #eee;/*makes navbar solid*/
      }
      /*U.S.2*/
      #header-img{
        object-fit: cover;/*fits image to cell*/
        width: 90%;/*70% of the cell*/
        max-height: 100%;/*height of cell*/
        float: center;/*align left*/
      }
      .links{
         margin: auto;
      }
      ul li{
        display: inline;/*makes links horizontal*/
        float: none;/*reset float*/
      }
      .nav-link{
        padding: 50px;/*spacing between links*/
      }
  body{
    padding-top: 20px;
  }
}
@media (max-width: 819px){
   body{
    padding-top: 40px;
  }
}
@media (max-width: 520px){
  .nav-link{
        padding: 10px;/*spacing between links*/
      }
}
              
            
!

JS

              
                
              
            
!
999px

Console