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>

<h1 id="title">Motorcyclist's Survey</h1>
<div id="container">
  <p id="description">A Personal Protection Questionaire</p>

  <form id="survey-form" action="#" method="GET">

    <div id="personal-info">
      <div class="name">
        <label for="name" id="name-label">Name <b>*</b></label>
        <input class="input-area" id="name" type="text" placeholder="Joe Rider" required>
      </div>
      <div class="email">
        <label for="email" id="email-label">Email <b>*</b></label>
        <input class="input-area" id="email" type="email" placeholder="Your Email" required>
      </div>
      <div class="age">
        <label for="number" id="number-label">Age</label>
        <input class="input-area" id="number" type="number" placeholder="Age" min="18" max="99">
      </div>
    </div>

    <p>How many years have you been riding?
      <select class="dropdown" name="years-ride">
          <option value=" " selected>--Please select one--</option>
          <option value="under one">0 - 11 months</option>
          <option value="1-5">1 - 5 years</option>
          <option value="6-10">6 - 10 years</option>
          <option value="11-15">7 - 15 years</option>
          <option value="16-20">16 - 20 years</option>
          <option value="21-25">21 - 25 years</option>
          <option value="25-30">26 - 30 years</option>
          <option value=">30">over 30 years</option>
        </select></p>

    <p>What type of riding do you do?
      <select class="dropdown" id="dropdown" name="rider-type">
          <option value="commuter">Commuter</option>
          <option value="weekendRider">Weekend rider</option>
          <option value="adventureTouring" selected>Adventure/Touring</option>
          <option value="offRoad">Off-road</option>
          <option value="other">Other</option>
        </select></p>

    <div class="gear-section">
      <fieldset class="fieldset">
        <legend>Do you wear protective gear?</legend>
        <label class="radiob" for="yes">
            <input id="yes" type="radio" name="safety-gear" value="yes">Yes
          </label>
        <label class="radiob" for="sometimes">
            <input id="sometimes" type="radio" name="safety-gear" value="sometimes">Sometimes
          </label>
        <label class="radiob" for="no">
            <input id="no" type="radio" name="safety-gear" value="no">No
          </label>
      </fieldset>

      <div class="gear-worn">
        <fieldset class="fieldset">
          <legend>What protective gear do you wear? (Choose all that apply)</legend>
          <label class="cbox" for="helmet">
              <input id="helmet" type="checkbox" class="protective-gear" value="helmet">Helmet
            </label>
          <label class="cbox" for="eye-protection">
              <input id="eye-protection" type="checkbox" class="protective-gear" value="eye">Eye protection
            </label>
          <label class="cbox" for="gloves">
              <input id="gloves" type="checkbox" class="protective-gear" value="gloves">Gloves
            </label>
          <label class="cbox" for="long-pants">
              <input id="long-pants" type="checkbox" class="protective-gear" value="pants">Long pants
            </label>
          <label class="cbox" for="jacket">
              <input id="jacket" type="checkbox" class="protective-gear" value="jacket">Jacket
            </label>
          <label class="cbox" for="body-armor">
              <input id="body-armor" type="checkbox" class="protective-gear" value="armor">Body Armor
            </label>
          <label class="cbox" for="riding-boots">
              <input id="riding-boots" type="checkbox" class="protective-gear" value="boots">Riding Boots
            </label>
          <label class="cbox" for="reflective">
              <input id="reflective" type="checkbox" class="protective-gear" value="reflective">Reflective vest
            </label>
          <label class="cbox" for="none">
              <input id="none" type="checkbox" class="protective-gear" value="none">Don't wear protective gear
            </label>
        </fieldset>
      </div>

      <div class="importance">
        <p>Score each of the following based on your decision when choosing protective gear</p>
        <div class="col-25" id="style">Style</div>
        <select class="dropdown col-75" id="style-score">
            <option value="">--Please select one--</option>
            <option value="1">1 - Not important</option>
            <option value="2">2 - A little</option>
            <option value="3">3 - Doesn't impact my decision</option>
            <option value="4">4 - Important</option>
            <option value="5">5 - Very important</option>
          </select>
        <div style="clear:both"></div>
        <div class="col-25" id="Comfort">Comfort</div>
        <select class="dropdown col-75" id="comfort-score">
            <option value="">--Please select one--</option>
            <option value="1">1 - Not important</option>
            <option value="2">2 - A little</option>
            <option value="3">3 - Doesn't impact my decision</option>
            <option value="4">4 - Important</option>
            <option value="5">5 - Very important</option>
          </select>
        <div style="clear:both"></div>
        <div class="col-25" id="Price">Price</div>
        <select class="dropdown col-75" id="price-score">
            <option value="">--Please select one--</option>
            <option value="1">1 - Not important</option>
            <option value="2">2 - A little</option>
            <option value="3">3 - Doesn't impact my decision</option>
            <option value="4">4 - Important</option>
            <option value="5">5 - Very important</option>
          </select>
        <div style="clear:both"></div>
        <div class="col-25" id="Protection">Protection</div>
        <select class="dropdown col-75" id="protection-score">
            <option value="">--Please select one--</option>
            <option value="1">1 - Not important</option>
            <option value="2">2 - A little</option>
            <option value="3">3 - Doesn't impact my decision</option>
            <option value="4">4 - Important</option>
            <option value="5">5 - Very important</option>
          </select>
        <div style="clear:both"></div>
        <div class="col-25" id="Visibility">Visibility</div>
        <select class="dropdown col-75" id="visibility-score">
            <option value="">--Please select one--</option>
            <option value="1">1 - Not important</option>
            <option value="2">2 - A little</option>
            <option value="3">3 - Doesn't impact my decision</option>
            <option value="4">4 - Important</option>
            <option value="5">5 - Very important</option>
          </select>
        <div style="clear:both"></div>
      </div>
    </div>

    <div class="mods">
      <fieldset class="fieldset">
        <legend>Have you made modifications to your motorcycle to make it more visible?</legend>
        <label class="radiob" for="yay">
            <input id="yay" type="radio" name="modifications" value="yes">Yes
          </label>
        <label class="radiob" for="nay">
            <input id="nay" type="radio" name="modifications" value="no">No
          </label>
      </fieldset>

      <div class="modifications">
        <fieldset class="fieldset">
          <legend>What modifications have you made? (Chose all that apply)</legend>
          <label class="cbox" for="headlight">
              <input id="headlight" type="checkbox" class="modified" value="headlight">Headlight modulator
            </label>
          <label class="cbox" for="led">
              <input id="led" type="checkbox" class="modified" value="led">LED Headlight/Taillights
            </label>
          <label class="cbox" for="reflect">
              <input id="reflect" type="checkbox" class="modified" value="reflective">Reflective stickers or Tape
            </label>
          <label class="cbox" for="brake">
              <input id="brake" type="checkbox" class="modified" value="brake">Modulating brake lights
            </label>
          <label class="cbox" for="other">
              <input id="other" type="checkbox" class="modified" value="other">Flags or Pennants
            </label>
        </fieldset>
      </div>
    </div>

    <p class="comments">Comments</p>
    <textarea id="comments" rows="8" cols="50" placeholder="Additional comments"></textarea>
    <button id="submit" type="submit">Submit</button>
  </form>
</div>

              
            
!

CSS

              
                body {
  border: 0px;
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
  background-image: url(https://raw.githubusercontent.com/sjrom-a/fccWebDesignProjects/master/surveyForm/images/deluxe.jpg);
  background-size: cover;
  font-family: 'Rubik', sans-serif;
  text-align: center;
}

#container {
  background: rgba(249, 249, 249, 0.8);
  border-radius: 4px;
  margin: 0px auto 10px auto;
  max-width: 80%;
  padding: 20px;
}

.gear-section,
.mods {
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  margin-bottom: 5px;
  padding: 10px;
}

.radiob:hover, .cbox:hover {
  background-color: #333;
  border-radius: 4px;
  color: #ccc;
}

fieldset {
  line-height: 1.5;
}

select {
  background-color: white;
}

#description {
  font-size: larger;
  font-weight: 500;
}

input:required {
  background-color: lightyellow;
}

.name,
.email,
.age {
  padding-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
  border-radius: 4px;
  border: 1px solid #ccc;
  transition: box-shadow .3s;
  outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  box-shadow: 0 1px 10px #999;
}

#number-label {
  padding-right: 20px;
}

b {
  color: red;
}

.input-area {
  font-size: small;
  height: 25px;
  padding-left: 10px;
  width: 280px;
}

.dropdown {
  font-size: small;
  height: 35px;
  width: 160px;
}

.gear-worn,
.modifications {
  margin: 0 auto;
  max-width: 75%;
  min-width: 95%;
  padding-top: 30px;
}

.fieldset {
  border-radius: 4px;
  display: inline-grid;
  text-align: left;
}

.protective-gear,
.modified {
  margin-left: 15px;
  margin-right: 10px;
}

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

.col-25 {
  float: left;
  width: 25%;
  margin-top: 12px;
  padding-right: 6px;
  text-align: right;
}

.col-75 {
  float: left;
  width: 50%;
  margin-top: 6px;
}

/* Clear floats after the columns */
.importance:after {
  content: "";
  display: table;
  clear: both;
}

.comments {
  margin-bottom: unset;
  text-align: left;
}

textarea {
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  font-size: small;
  height: 150px;
  padding: 10px 15px;
  resize: none;
  width: 100%;
}

button {
  background-color: #59ace0;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 15px;
  height: 40px;
  width: 80px;
  transition: background-color .5s;
  border: none;
  box-shadow: 0 1px 10px #999;
}

button:hover {
  background-color: #1d6fa3;
}

              
            
!

JS

              
                // coded by sjroma
const projectName = 'survey-form';
localStorage.setItem('example_project', 'Survey Form');

              
            
!
999px

Console