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

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

<header id="header">
  <img src="//cdn.kmp.link/img/tardis.png" alt="Tardis" id="header-img" />
  <h1>TARDIS Crafters</h1>

  <nav id="nav-bar">
    <ul>
      <li><a href="#features" class="nav-link">Features</a></li>
      <li><a href="#tour" class="nav-link">Take a Tour</a></li>
      <li><a href="#pricing" class="nav-link">Pricing</a></li>
    </ul>
  </nav>
</header>

<div class="container">
  <form method="post" action="https://www.freecodecamp.com/email-submit" id="form">
    <h3>Stay Up to Date</h3>
    <input type="email" id="email" name="email" placeholder="Enter your email address">
    <br/>
    <input type="submit" value="Get Started" id="submit" class="btn" />
  </form>

  <h2 id="features">Features</h2>
  <div id="features-box">
    <div class="row">
      <div class="features-img">
        <img src="//cdn.kmp.link/img/tardis.png" alt="Tardis"/>
      </div>
      <div class="features-desc">
        <h3>Bigger on the Inside</h3>
        <p>Always a surprise to guests and companions. It may look small, but the Time Lord Scientists have perfected the manipulation of space-folding to fit everything you would ever need inside.</p>
      </div>
    </div>
    <div class="row">
      <div class="features-img">
        <img src="//cdn.kmp.link/img/sonic-screwdriver.png" alt="Sonic Screwdriver"/>
      </div>
      <div class="features-desc">
        <h3>Customied Sonics!</h3>
        <p>Each TARDIS generates its own customized Sonic device, so your sonic screwdriver/trowel/blaster will match the look of your Console Room, and do just about everything*</p>
        <p><small><em>* Some Sonic devices may not work on wood</em></small></p>
      </div>
    </div>
    <div class="row">
      <div class="features-img">
        <img src="//cdn.kmp.link/img/key-security.png" alt="TARDIS Key"/>
      </div>
      <div class="features-desc">
        <h3>Never Lose Your Keys Again</h3>
        <p>Each TARDIS comes with backup keys in convenient locations, so you will never have to worry about losing your keys again.</p>
      </div>
    </div>
  </div>

  <h2 id="tour">Take a Tour</h2>
  <div id="video-box" class="mx-auto">
    <div data-video="5kjMCJ-7a3k" data-startseconds="0" data-endseconds="165" data-height="360" data-width="640" id="video">
    </div>
  </div>

  <h2 id="pricing">Pricing</h2>
  <div id="pricing-boxes">
    <div class="pricing-box">
      <h3>Type 40</h3>
      <p><del>$2000</del> <strong><em>$100</em></strong></p>
      <p>Great starter model</p>
      <p>Navigation is as-is</p>
        <p>Chameleon Circuit is stuck</p>
      <button class="btn">Select</button>
    </div>
    <div class="pricing-box">
      <h3>Type 50</h3>
      <p><strong>$2000</strong></p>
      <p>Easily cross dimensions</p>
      <p>Seating for 500</p>
      <p>Pool is piranha-free</p>
      <button class="btn">Select</button>
    </div>
    <div class="pricing-box">
      <h3>Type 87-A</h3>
      <p><strong>$6000</strong></p>
      <p>Voice-activated Navigation</p>
      <p>Sonic Screwdriver Maintenance</p>
      <p>Increased memory banks for your favorite consoles!</p>
      <button class="btn">Select</button>
    </div>
  </div>

  <footer>
    <nav>
      <ul>
        <li><a href="#">Privacy</a><li>
        <li><a href="#">Terms</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
    </nav>
    <br/>
    <p>&copy; TARDIS Crafters</p>
  </footer>
</div>
              
            
!

CSS

              
                body
  margin-top: 90px
  background-color: #eee

header
  position: fixed
  top: 0
  width: 100%
  background-color: rgba(51,102,204,.25)
  height: 70px
  padding: 10px
  padding-left: 50px
  padding-right: 50px
  h1
    float: left
    line-height: 50px
    font-family: 'Audiowide', cursive
  img
    height: 50px
    float: left

.container h2
  text-indent: -1000px

header nav
  float: right
  height: 70px
  display: inline-block
  margin: 0
  padding: 0
  ul
    list-style: none
    margin: 0
    padding: 0
    li
      float: left
      width: 160px
      text-align: center
      line-height: 40px
      a
        color: #000
        display: block
        &:hover
          text-decoration: none

form
  text-align: center
  input[type='email']
    width: 30%
  input[type='submit']
    width: 200px
    margin: 20px

.btn
  background-color: #fc0
  font-weight: 900
  text-transform: uppercase
  padding: 7px
  cursor: pointer

#video-box
  width: 640px
    
#features-box
  .row
    width: 80%
    min-width: 900px
    margin: 40px auto
    .features-img
      float: left
      height: 80px
      width: 10%
      line-height: 80px
      font-size: 40pt
      text-align: center
      img
        max-width: 100%
    .features-desc
      width: 90%
      padding-left: 20px
      
footer
  background-color: #ccc
  padding: 10px
  margin-top: 30px
  text-align: right
  overflow: auto
  nav
    width: 240px
  nav, p
    float: right
    display: block
    ul
      list-style: none
      margin: 0
      padding: 0
      li
        width: 80px
        float: left
        a
          text-decoration: none
          display: block
          text-align: center
          color: #000
          &:hover
            text-decoration: none
    
  
#pricing-boxes
  overflow: auto
  display: flex
  justify-content: space-around
  .pricing-box
    width: 300px
    text-align: center
    border: 1px #000 solid
    border-radius: 5px
    background-color: #fff
    h3
      padding: 10px
      background-color: #dedede
      font-size: 1.5em
    button
      margin-bottom: 10px
    strong
      font-size: 150%
      
@media screen and (max-width: 900px)
  header h1
    font-size: 125%
    width: 150px
    line-height: 25px
    nav ul li
      width: 125px
  #pricing-boxes
    display: block
    width: 100%
    .pricing-box
      margin: auto
      margin-bottom: 20px
      
              
            
!

JS

              
                function onYouTubeIframeAPIReady() {
        var ctrlq = document.getElementById("video");
        var player = new YT.Player('video', {
          height: ctrlq.dataset.height,
          width: ctrlq.dataset.width,
          events: {
            'onReady': function(e) {
              e.target.cueVideoById({ 
                videoId: ctrlq.dataset.video,
                startSeconds: ctrlq.dataset.startseconds,
                endSeconds: ctrlq.dataset.endseconds
              });
            }
          } 
        }); 
      } 
              
            
!
999px

Console