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 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

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

<!-- Based on the tutorial: https://www.youtube.com/watch?v=moBhzSC455o-->
<!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>Stream on a Budget</title>
  <script defer src="https://use.fontawesome.com/releases/v5.6.3/js/all.js" integrity="sha384-EIHISlAOj4zgYieurP0SdoiBYfGJKkgWedPHH4jCzpCXLmzVsw1ouK59MuUtP4a1" crossorigin="anonymous"></script>
</head>
<body>
  <div class="wrapper" id="home">
    <header id="header">
      <nav id="nav-bar" class="main-nav">
        <div class="title">
          <img id="header-img" src="https://icon-icons.com/icons2/783/PNG/48/stream_icon-icons.com_64781.png" alt="logo"> <h1> Stream on a Budget</h1>
        </div>
        <div class="links">
          <ul>
            <li><a class="nav-link" href="#home">Home</a></li>
            <li><a class="nav-link" href="#deals">Deals</a></li>
            <li><a class="nav-link" href="#tips">Tips</a></li>
            <li><a class="nav-link" href="#contact">Get in Touch</a></li>
          </ul>
        </div>
      </nav>
    </header>
    
    <section class="presentation">
      <img src="https://images.pexels.com/photos/1509428/pexels-photo-1509428.jpeg?auto=compress" alt="">
      <div class="content">
        <h2>Focus your channel on the content while keeping the costs low</h2>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed mollis aliquet luctus. Nullam sed ullamcorper massa. Pellentesque nec dui eleifend, tristique ex a, iaculis urna. Nunc in tortor auctor, varius dolor vel, tincidunt tortor.
        </p>
        <div class="readmore">
          <a href="#" class="btn">Learn More</a>
        </div>
      </div>
    </section>
    
    <section class="deals" id="deals">
      <h2 class="section-title">Today's Deals</h2>
      <div class="content">
        <div class="card">
          <div class="card-column">
            <div class="card-image"><img src="https://images-na.ssl-images-amazon.com/images/I/61LWgKDqFkL._SL1500_.jpg" alt=""></div>
            <div class="card-button">
              <a href="https://www.amazon.co.uk/Logitech-C920-Pro-Webcam-Recording/dp/B006A2Q81M/"><div class="btn">Buy Now</div></a>
                
            </div>
          </div>
          <div class="card-column">
            <div class="card-title"><h3>Logitech C920 HD Pro Webcam</h3></div>
            <div class="card-price">
              <p class="price"><s>£89.99</s> <strong>£54.99</strong></p>
            </div>
            <div class="card-description">
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sit amet orci non enim venenatis tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus.</p> 
              <p>Aenean non commodo metus, eget laoreet elit. Suspendisse hendrerit nunc quis pellentesque sollicitudin.</p></div>
          </div>
        </div>

        <div class="card">
          <div class="card-column">
            <div class="card-image"><img src="https://images-na.ssl-images-amazon.com/images/I/91C4e69Ag7L._SL1500_.jpg" alt=""></div>
            <div class="card-button">
              <a href="https://www.amazon.co.uk/AmazonBasics-127cm-Lightweight-Tripod-Bag/dp/B00XI87KV8/"><div class="btn">Buy Now</div></a>
            </div>
          </div>
          <div class="card-column">
            <div class="card-title"><h3>AmazonBasics 127cm (50") Lightweight Tripod with Bag
</h3></div>
            <div class="card-price">
              <p class="price"><s>£19.99</s> <strong>£11.99</strong></p>
            </div>
            <div class="card-description">
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sit amet orci non enim venenatis tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus.</p> 
              <p>Aenean non commodo metus, eget laoreet elit. Suspendisse hendrerit nunc quis pellentesque sollicitudin.</p></div>
          </div>
        </div>
        
        <div class="card">
          <div class="card-column">
            <div class="card-image"><img src="https://images-na.ssl-images-amazon.com/images/I/614biBP5dpL._SL1024_.jpg" alt=""></div>
            <div class="card-button">
              <a href="https://www.amazon.co.uk/Lavalier-Microphone-Smartphone-Canon-Camera/dp/B00MPDYGBE/"><div class="btn">Buy Now</div></a>
                
            </div>
          </div>
          <div class="card-column">
            <div class="card-title"><h3>BOYA BY-M1 3.5 mm Lavalier Microphone for Smartphone and Canon/Nikon Camera - Black
</h3></div>
            <div class="card-price">
              <p class="price"><s>£14.99</s> <strong>£14.95</strong></p>
            </div>
            <div class="card-description">
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sit amet orci non enim venenatis tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus.</p> 
              <p>Aenean non commodo metus, eget laoreet elit. Suspendisse hendrerit nunc quis pellentesque sollicitudin.</p></div>
          </div>
        </div>
        
        <div class="card">
          <div class="card-column">
            <div class="card-image"><img src="https://images-na.ssl-images-amazon.com/images/I/51Kndlk7HwL._SL1000_.jpg" alt=""></div>
            <div class="card-button">
              <a href="https://www.amazon.co.uk/Dimmable-Photography-Lighting-PANASONIC-Camcorder/dp/B06Y363XB8/"><div class="btn">Buy Now</div></a>
                
            </div>
          </div>
          <div class="card-column">
            <div class="card-title"><h3>ZCTL Dimmable LED Video Light Pad Photo Studio Light Panel Photography Lighting Kit With AC Adapter
</h3></div>
            <div class="card-price">
              <p class="price"><s>£14.99</s> <strong>£9.99</strong></p>
            </div>
            <div class="card-description">
              <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. In sit amet orci non enim venenatis tempus. Interdum et malesuada fames ac ante ipsum primis in faucibus.</p> 
              <p>Aenean non commodo metus, eget laoreet elit. Suspendisse hendrerit nunc quis pellentesque sollicitudin.</p></div>
          </div>
        </div>
      </div>
    </section>
    
    <section class="tips" id="tips">
      <h2 class="section-title">Tip of the day</h2>
      <div class="content">
        <div class="video-container">
          <iframe id="video" width="100%" height="auto" src="https://www.youtube.com/embed/rWSfPOZiHD8" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
        </div>
      </div>
    </section>
    
    <section class="contact" id="contact">
      <form id="form" action="https://www.freecodecamp.com/email-submit">
        <h2 class="section-title">Get the latest products and discounts to your inbox</h2>
        <div class="email">
          <input name="email" id="email" type="email" placeholder="Enter your email address" required/>
        </div>
        <div class="submit">
          <input id="submit" class="btn" type="submit" value="Subscribe"></input>
        </div>
      </form>
    </section>

  </div>
  
  <footer>
    <h4>Stream on a Budget &copy; 2019</h4>
    <p>Made by Aléxio Rodrigues</p>
  </footer>
</body>
</html>
              
            
!

CSS

              
                /* CSS Variables */
:root {
  --primary: #ddd;
  --dark: #333;
  --light: #fff;
  
  
  --color-card: #ABA7A7;
  --color-b: #CC527A;
  --color-primary: #E8175D;
  --color-d: #474747;
  --color-background: #363636;
  
  
  --shadow: 0 1px 5px rgba(104, 104, 104, 0.8);
}

/* Global */
html {
  scroll-behavior: smooth;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  color: var(--dark)
}

body {
  background: var(--color-background);
  line-height: 1.4;
}

.btn {
  background: var(--color-primary);
  color: var(--light);
  padding: 0.6rem 1.3rem;
  text-decoration: none;
  border: 0;
  border-radius: 5px;
}

.btn:hover {
  background: var(--dark);
  color: var(--light);
}

img {
  max-width: 100%;
}

a {
  text-decoration: none;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  color: #fff;
}

.wrapper {
  display: grid;
  grid-gap: 20px;
  margin-left: 10rem;
  margin-right: 10rem;
  margin: 30px 50px;
}

/* Navigation */
#header {
  overflow: hidden;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}

.main-nav {
  background-color: var(--color-primary);
  display: grid;
  grid-gap: 20px;
  padding: 0;
  padding-left: 20px;
  padding-right: 20px;
  list-style: none;
  grid-template-columns: auto 1fr;
  justify-items: right;
  align-items: center;
}

.main-nav ul {
  display: grid;
  grid-gap: 20px;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  
}

.main-nav .title {
  display: flex;
  justify-items: center;
  align-items: center;
}

.main-nav h1 {
  display: block;
  text-decoration: none;
  padding: 0.8rem;
  margin: 0;
  text-align: center;
  color: var(--light);
  text-transform: uppercase;
  font-size: 1.4rem;
}

.main-nav a {
  display: block;
  padding: 0.8rem;
  border-radius: 5px;
  text-decoration: none;
  text-align: center;
  color: var(--light);
  text-transform: uppercase;
  font-size: 1.1rem;
}

.main-nav a:hover {
  background: var(--dark);
  color: var(--light);
}

/* Presentation */
.presentation {
  background: var(--primary);
  box-shadow: var(--shadow);
  display: grid;
  grid-gap: 60px;
  grid-template-columns: repeat(2, 1fr);
  align-items: center;
  justify-self: center;
  padding: 40px;
  margin-top: 100px;
}

.presentation .content {
  display: flex;
  flex-direction: column;
  align-self: center ;
}

.presentation .content h2 {
  margin: 0;
}

.presentation .content .readmore {
  margin-top: 10px;
  margin-bottom: 20px;
}

/* Deals */
.deals {
  display: grid;
}

.deals .content {
  display: grid;
  grid-gap: 30px;
  grid-template-columns: repeat(3, 1fr);
}

.card {
  background: var(--primary);
  box-shadow: var(--shadow);
  display: flex;
  padding: 20px;
  flex-flow: column no-wrap;
  justify-content: space-between;
}

.card-column {
  padding: 20px;
}

.card-image {
  grid-area: image;
  display: grid;
  width: 100%;
  height: auto;
  justify-items: center;
}

.card-button {
  grid-area: button;
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.card-title {
  grid-area: title;
  display: flex;
}

.card-title h3 {
  margin-top: 0;
  margin-bottom: 0;
}

.card-price .price {
  font-size: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.card-description {
  grid-area: description;
  display: flex;
  flex-direction: column;
}

/* Tips */
.tips {
  text-align: center;
}

.tips .content {
  background: var(--primary);
  box-shadow: var(--shadow);
  padding: 20px;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  padding-top: 30px;
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Contact */
.contact {
  background: var(--primary);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr 1fr;
  justify-items: center;
  align-items: center;
  padding: 40px;
  margin-top: 60px;
  margin-bottom: 60px;
}

.contact h2{
  color: var(--color-background);
}

.contact .email {
  width: 100%;
  margin-bottom: 25px;
  display: flex;
  justify-content: center;
  align-content: center;
}

.contact .email input {
  max-width: 500px;
  width: 100%;
  padding: 5px;
}

.contact .submit {
  margin: 30dp;
  display: flex;
  justify-content: center;
  align-content: center;
}

/* Footer */
footer {
  position: flex; 
  padding: 15px;
  background: var(--color-card);
  color: var(--light);
  text-align: center;
}

footer h4 {
  margin: 5px;
  font-weight: bold;
  color: var(--color-background);
}

footer p {
  margin: 5px;
  font-weight: normal;
  color: var(--color-background);
}

/* Media Queries */
@media(max-width: 1500px) {
  .deals .content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media(max-width: 1100px) {
  .deals .content {
    grid-template-columns: repeat(1, 1fr);
  }
}


@media(max-width: 900px) {
  .wrapper {
    margin-left: 0rem;
    margin-right: 0rem;
  }
  
  .main-nav {
    display: block;
  }
  
  .card {
    display: inline;
  }
  
  .card-image img {
    max-width: 400px;
  }
  
  links {
    width: 100%;
  }
  
  .main-nav ul {
    grid-template-columns: 1fr;
  }
  
  .presentation {
    grid-template-columns: 1fr;
  }
  
  .deals .content {
    grid-template-columns: repeat(1, 1fr);
  }

  /* Use this as template. Then remove */
  .info .btn {
    display: block;
    text-align: center;
    margin: auto;
  }  
}

@media(max-width: 600px) {  
  .deals .content {
    grid-template-columns: repeat(1, 1fr);
  }
}
              
            
!

JS

              
                // !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 

              
            
!
999px

Console