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

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

<body>
 <header class="header">
  <h1 id="title"> Backpackers on the Pacific Crest Trail </h1>
  <p id="description"> Thank you for taking the time to help us collect data on how hikers use the trail. </p>
 </header>
 <form id="survey-form">
  <div class="form-group">
   <label id="name-label" for="name"> Name </label>
   <input id="name" name="name" class="form-control" type="text" placeholder="Enter your name" required>
  </div>
  <div class="form-group">
   <label id="email-label" for="email"> Email </label>
   <input id="email" name="email" class="form-control" type="email" placeholder="Enter your email" required>
  </div>
  <div class="form-group">
   <label id="number-label" for="number"> Age </label>
   <input id="number" name="age" class="form-control" type="number" min="5" max="118" placeholder="Enter your age" required>
  </div>
  <div class="form-group">
   <p> Which option best describes your most recent backpacking trip on the PCT?</p>
   <select id="dropdown" name="trip" class="form-control" required>
    <option class="option-text" disabled selected value> Select recent trip </option>
    <option value="short"> Short overnight </option>
    <option value="weekend"> Weekend Warrior </option>
    <option value="week"> Week long trip </option>
    <option value="section"> Section hiking </option>
    <option value="thru"> Thru hiking </option>
   </select>
  </div>
  <div class="form-group">
   <p> Would you consider yourself an experienced backpacker? </p>
   <label for="definitely">
    <input id="definitely" type="radio" name="experience" value="definitely" required> Definitely </label>
   <label for="sometimes">
    <input id="sometimes" type="radio" name="experience" value="sometimes"> Sometimes, depending on my company </label>
   <label for="no">
    <input id="no" type="radio" name="experience" value="no"> No, I'm a newbie </label>
  </div>
  <div class="form-group">
   <p> How would you classify your pack base weight? <span id="baseweight"> (base weight includes the weight of the backpack plus gear, excluding consumables like food, water, and fuel) </span></p>
   <select id="dropdown2" name="weight" class="form-control" required>
    <option class="option-text" disabled selected value> Select base weight </option>
    <option value="ultralight"> Ultralight- below 10 lbs </option>
    <option value="light"> Light- below 15lbs </option>
    <option value="traditional"> Traditional- above 15lbs </option>
   </select>
  </div>
  <div class="form-group">
   <p> What type of navigation tools did you use or bring? <span id="check"> (Check all that apply) </span> </p>
   <label for="trail-app">
    <input id="trail-app" type="checkbox" name="navigation" value="trail-app"> Trail specific App (halfmile, guthook, etc.) </label>
   <label for="map-app">
    <input id="map-app" type="checkbox" name="navigation" value="map-app"> General map app (avenza, maps.me, caltopo, etc.)</label>
   <label for="gps">
    <input id="gps" type="checkbox" name="navigation" value="gps"> Handheld GPS </label>
   <label for="detailed">
    <input id="detailed" type="checkbox" name="navigation" value="detailed"> Detailed printed maps of trail section</label>
   <label for="overview">
    <input id="overview" type="checkbox" name="navigation" value="overview"> Overview map of National Forest or Park </label>
   <label for="compass">
    <input id="compass" type="checkbox" name="navigation" value="compass"> Compass </label>
   <label for="none">
    <input id="none" type="checkbox" name="navigation" value="none"> No navigation tools </label>
   <label id="other-label" for="other">
    <input id="other" type="checkbox" name="navigation" value="other"> Other </label><input name="other-text" placeholder="Enter your navigation tool" type="text" id="other-text">
  </div>
  <div class="form-group">
   <p> Did you bring a personal locator beacon or satellite messenger? </p>
   <label for="yes">
    <input id="yes" type="radio" name="plb" value="yes" required> Yes </label>
   <label for="nope">
    <input id="nope" type="radio" name="plb" value="no"> No </label>
  </div>
  <div class="form-group">
   <p> Any comments on your experience using the trail? </p>
   <textarea id="comment" name="comment" placeholder="Enter comments here..."></textarea>
  </div>
  <div class="form-group">
   <button id="submit" type="submit"> Submit </button>
  </div>
 </form>
</body>
              
            
!

CSS

              
                /*  Pct color: rgba(0, 115, 119)*/
body {
 background-image: linear-gradient(
   rgba(128, 128, 128, 0.3),
   rgba(128, 128, 128, 0.3)
  ),
  url("https://res.cloudinary.com/tarakleemann/image/upload/v1589248096/Images/IMG_4813_mm6bgh.jpg");
 background-repeat: no-repeat;
 background-attachment: fixed;
 background-size: cover;
 background-position: top;
 font-family: "Roboto", sans-serif;
 color: white;
}

.header {
 text-align: center;
 margin: auto;
 color: black;
 font-size: 1.5em;
 font-weight: bold;
 max-width: 100%;
 background-image: linear-gradient(
  rgba(255, 255, 255, 0.4),
  rgba(255, 255, 255, 0.4)
 );
 border-radius: 10px;
 padding: 10px;
 border: 5px solid rgba(230, 216, 69, 0.4);
}

#survey-form {
 max-width: 60%;
 margin: auto;
 background-image: linear-gradient(
  rgba(0, 115, 119, 0.8),
  rgba(0, 115, 119, 0.8)
 );
 border-radius: 10px;
 padding: 20px;
 border: 5px solid rgba(0, 0, 0, 0.7);
 font-size: 1.3em;
 margin-top: 10px;
}

.form-group {
 margin-bottom: 40px;
}
label {
 display: block;
}

#name,
#email,
#number {
 box-sizing: border-box;
 margin-top: 10px;
 margin-left: 0px;
 width: 100%;
 font-family: "Roboto", sans-serif;
 font-size: 0.8em;
}
#dropdown,
#dropdown2 {
 padding: 10px;
 border-radius: 10px;
 width: 100%;
 font-family: "Roboto", sans-serif;
 font-size: 0.8em;
}

input {
 padding: 10px;
 border-radius: 10px;
}
.form-control {
 color: grey;
}

#other-label {
 display: inline-block;
}
#other-text {
 margin-left: 10px;
 padding: 5px;
 font-family: "Roboto", sans-serif;
 width: 50%;
 color: grey;
}

textarea {
 height: 100px;
 width: 100%;
 border-radius: 10px;
 font-family: "Roboto", sans-serif;
 font-size: 0.8em;
 color: grey;
}
.form-group p {
 margin-bottom: 10px;
}
#baseweight,
#check {
 font-size: 0.7em;
}

button {
 width: 100%;
 font-family: "Roboto", sans-serif;
 font-size: 0.9em;
 font-weight: bold;
 height: 40px;
 border-radius: 10px;
 color: black;
 background-color: rgba(230, 216, 69, 0.6);
 border: none;
}
button:hover {
 background-color: rgba(230, 216, 69, 0.9);
 cursor: pointer;
}

@media (max-width: 1000px) {
 .header {
  font-size: 1em;
 }
 #survey-form {
  max-width: 80%;
  font-size: 90%;
 }
}

              
            
!

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