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>

<head>
  <title>Generic Landing Page Design</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>

<body>

  <header id="header" class="fixed">
    <img id="header-img" src="https://www.dropbox.com/s/jz1x1cfzgkdc701/climatChangePartnership_noText.jpg?dl=1" alt="A modern company logo">
    <h3 id="header-name">Company Name</h3>
    <nav id="nav-bar">
      <a class="nav-link" href="#about">about</a>
      <a class="nav-link" href="#products">products</a>
      <a class="nav-link" href="#insights">insights</a>
    </nav>
  </header>

  </div>

  <div id="hero-div">
    <div>
      <div id="hero-text">Empower and encourage your people</div>
      <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
      <form id="form" method="GET" action="https://freecodecamp.com/email-submit">
        <div id="email-flex" class="bg-color">
          <div>
            <input type="email" name="email" id="email" class="input-field" required placeholder="enter your email address" required>
          </div>
          <div>
            <input type="submit" value="Submit" id="submit" class="button">
          </div>
        </div>
      </form>
    </div>
    <div id="hero-img"></div>
  </div>

  <div id="about" class="content-bg bg-color content-pad-top">
    <div class="content-div">
      <div><img class="item-img round-img" src="https://www.dropbox.com/s/060igby4jtknp5t/log.png?dl=1" alt="a tree stump"></div>
      <div class="item-copy">
        <div class="item-header">About our Team</div>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
      </div>
    </div>
  </div>

  <div id="products" class="bg-color">
    <div class="content-div">
      <div><img class="item-img round-img" src="https://www.dropbox.com/s/kmuw87r7u9imewh/fire-tree.png?dl=1" alt="a tree on fire"></div>
      <div class="item-copy">
        <div class="item-header">Our Products</div>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
      </div>

    </div>
  </div>

  <div id="insights" class="bg-color">
    <div class="content-div">
      <div><img class="item-img round-img" src="https://www.dropbox.com/s/2kfohks60ivagmi/team.png?dl=1" alt="a team in a workplace"></div>
      <div class="item-copy">
        <div class="item-header">Insight into our Process</div>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
      </div>
    </div>
  </div>

  <div id="video-div">
    <iframe id="video" width="640" height="360" src="https://player.vimeo.com/video/229854054?color=ffffff&title=0&byline=0&portrait=0" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
    <script src="https://player.vimeo.com/api/player.js"></script>
  </div>

  <footer>
    <div>
      <h2>Reach out</h3><br> US
        <br> 415 Main Street<br> Suite 500<br> Cloverfield, New York 34567<br><br>
        <a href="#">(888) 888-0000</a><br><br> France
        <br> 71 rue des Saints-Pères<br> 75006 Paris<br><br>
        <a href="#">06 23 12 45 54</a><br><br>
        <a href="#">info@companyname.com</a>

    </div>
    <div class="footer-list">
      <h2>Follow</h2><br>
      <a href="#">facebook</a><br>
      <a href="#">twitter</a><br>
      <a href="#">instagram</a><br>
      <a href="#">vimeo</a><br>
      <a href="#">youtube</a>
    </div>

    <div class="footer-list">
      <h2>Find</h2><br>
      <a href="#">sitemap</a><br>
      <a href="#">faq</a><br>
      <a href="#">privacy policy</a><br>
      <a href="#">copyright policy</a>
    </div>

  </footer>

  <!-- smooth scrolling script -->
  <script>
    $(document).ready(function() {
      // Add smooth scrolling to all links
      $("a").on('click', function(event) {
        // Make sure this.hash has a value before overriding default behavior
        if (this.hash !== "") {
          // Prevent default anchor click behavior
          event.preventDefault();
          // Store hash
          var hash = this.hash;
          // Using jQuery's animate() method to add smooth page scroll
          $('html, body').animate({
            scrollTop: $(hash).offset().top
          }, 600, function() {
            // Add hash (#) to URL when done scrolling (default click behavior)
            window.location.hash = hash;
          });
        } // End if
      });
    });
  </script>
</body>

</html>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Montserrat:300, 400");

:root {
  --full-width: 100%;
  --bg-color: rgb(166, 242, 204); /* mint green */
  --neutral-color: rgb(222, 222, 222); /* light gray */
  --font-size: 1em;
  --main-width: 890px;
}

body {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-size: var(--font-size);
}

.fixed {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: #fff;
}

.bg-color {
  background-color: var(--bg-color);
}

#policy-div {
  height: 30px;
  width: var(--full-width);
  margin-bottom: 25px;
}

header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-evenly;
  width: var(--main-width);
  margin: 0 auto;
  border-bottom: 3px solid var(--neutral-color);
}

#header-img {
  max-width: 3em;
}

#header-name {
  font-family: "Montserrat", sans-serif;
  font-size: 1.2em;
}

#nav-bar {
  align-self: center;
  margin-left: auto;
  width: 15em;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
}

.nav-link {
  font-size: 0.9em;
}

a {
  text-decoration: none;
  color: #000;
}

a:hover {
  border-bottom: 3px solid var(--neutral-color);
}

#hero-div {
  display: flex;
  flex-direction: row;
  width: var(--main-width);
  margin: 0 auto;
  padding-top: 240px;
}

#form {
  display: flex;
  flex-direction: column;
  max-width: 450px;
}

#hero-text {
  font-size: 2.4em;
  font-family: "Montserrat", sans-serif;
}

#email-flex {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  max-width: 340px;
  height: 40px;
  padding: 0.5em;
  border-radius: 10px;
}

.input-field {
  min-width: 220px;
}

.button {
  border-radius: 3px;
  background-color: rgb(7, 68, 195);
  border: 1px solid rgb(7, 68, 195);
  color: #fff;
  padding: 7px;
}

#hero-img {
  width: 100%;
  background: #fff
    url(https://www.dropbox.com/s/m6wmxknnars6x3h/green-energy.jpg?dl=1)
    no-repeat center;
  -webkit-background-size: contain;
  -moz-background-size: contain;
  -o-background-size: contain;
  background-size: auto 100%;
}

.content-bg {
  margin-top: 80px;
}

.content-pad-top {
  padding-top: 90px;
}

.content-div {
  margin: 0 auto;
  max-width: var(--main-width);
  height: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  padding: 80px;
}

.round-img {
  border-radius: 20%;
  padding: 50px;
}

.item-img {
  background-color: #fff;
  width: 200px;
  height: auto;
}

.item-copy {
  display: flex;
  flex-direction: column;
  max-width: 400px;
  padding-left: 50px;
}

.item-header {
  font-size: 1.8em;
  font-family: "Montserrat", sans-serif;
}

#video-div {
  display: flex;
  justify-content: center;
  padding: 190px 0 150px 0;
  width: 100%;
  margin: 0 auto;
}

footer {
  height: 350px;
  background-color: #000;
  color: #fff;
  font-size: 0.7em;
  line-height: 1.4em;
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-content: space-around;
  padding-top: 40px;
}

.footer-list {
  padding-left: 150px;
}

footer a {
  color: var(--neutral-color);
}

footer a:hover {
  color: var(--bg-color);
  border-bottom: 2px solid var(--bg-color);
}

@media screen and (min-width: 400px) and (max-width: 890px) {
  :root {
    --main-width: 80%;
  }

  #hero-img {
    display: none;
  }
}

@media screen and (max-width: 399px) {
  :root {
    --main-width: 90%;
  }

  #hero-img {
    display: none;
  }

  #header-name {
    display: none;
  }

  #email-flex {
    flex-direction: column;
    align-items: center;
    align-content: space-around;
    height: 50px;
    padding: 2em;
    border-radius: 10px;
  }

  #submit {
    margin-top: 15px;
  }

  .content-pad-top {
    padding-top: 10px;
  }

  .content-div {
    padding: 40px 20px 40px 20px;
  }

  #video-div {
    padding: 10px 0 80px 0;
  }
}

@media screen and (max-width: 720px) {
  .content-div {
    flex-direction: column;
    justify-content: center;
  }

  .item-img {
    width: 150px;
    height: auto;
  }

  .item-header {
    margin-top: 20px;
  }

  .item-copy {
    margin: 0 auto;
    padding-left: 0px;
    max-width: 90%;
  }

  footer {
    height: 800px;
    flex-direction: column;
    align-content: space-around;
    padding: 40px 0px 40px 60px;
  }

  .footer-list {
    padding: 30px 0 30px 0;
  }
}

@media screen and (max-width: 500px) {
  h3 {
    display: none;
  }
}

              
            
!

JS

              
                

              
            
!
999px

Console