Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

<div class="container">
  <h1 id="title">Survey Form</h1>
  <p id="description">Tell us more about yourself</p>
  <p id="required">*Required</p>
  <form id="survey-form" method="POST">
    <div class="label">
      <label id="name-label">Name<span>*</span></label>
    </div>
    <div>
      <input id="name" type="text" placeholder="Your answer" class="input-field" required>
    </div>
    <div class="label">
      <label id="email-label">Email<span>*</span></label>
    </div>
    <div>
      <input id="email" type="email" placeholder="Your answer" class="input-field" required>
    </div>
    <div class="label">
      <label id="number-label">Age<span>*</span></label>
    </div>
    <div>
      <input id="number" type="number" min="1" max="130" placeholder="Your answer" class="input-field" required>
    </div>
    <div class="label">
      <label for="dropdown">What option describes your current role?</label>
    </div>
      <select id="dropdown" class="input-field">
        <option disabled value selected="selected" >Choose</option>
        <option value="Student">Student</option>
        <option value="Full-time Worker">Full-time Worker</option>
        <option value="Part-time Worker">Part-time Worker</option>
        <option value="Full-time learner">Full-time learner</option>
        <option value="Prefer not to say">Prefer not to say</option>
      </select>
    <fieldset class="label">
      <legend>How likely would you recommend Squareviking to a friend?</legend>
      <div class="option">
        <input type="radio" value="definitely" name="recommend" checked>
        <label>Definitely</label>
      </div>
      <div class="option">
        <input type="radio" value="maybe" name="recommend">
        <label>Maybe</label>
      </div>
      <div class="option">
        <input type="radio" value="notsure" name="recommend">
        <label>Not sure</label>
      </div>
    </fieldset>
    <fieldset class="label">
      <legend>
        Things that should be improved in the future:
        <br/>
        <i class="option">(Check all that apply)</i>
      </legend>
      <div class="option">
        <input type="checkbox" value="frontend">
        <label for="frontend">Front end Projects</label>
      </div>
      <div class="option">
        <input type="checkbox" value="backend">
        <label for="backend">Back end Projects</label>
      </div>
      <div class="option">
        <input type="checkbox" value="design">
        <label for="design">Design</label>
      </div>
      <div class="option">
        <input type="checkbox" value="data-visualisations">
        <label for="data-visualisations">Data visualisations</label>
      </div>
    </fieldset>
    <div class="label">
      <label for="textarea">Any comments or suggestions?</label>
    </div>
    <div>
      <textarea  
      class="input-field">
      </textarea>
    </div>
    <button id="submit" type="submit">Submit</button>
  </form>
</div>
<footer>Written & coded by Nikita Jiandani</footer>
              
            
!

CSS

              
                body {
  text-align: center;
  background: #56CCF2;
  font-family: 'Roboto', sans-serif;
}

h1 {
  letter-spacing: 1px;
}

p {
  font-size: 14px;
  margin: 3px 0px 0px 0px;
}

form span {
  color: red;
}

fieldset {
  border: none;
}

fieldset div {
  padding: 2px;
}

button {
  font-size: 20px;
  margin-top: 20px;
  border-radius: 3px;
  background: #2F80ED;
  color: white;
  padding: 10px 25px 10px 25px;
}

footer {
  padding: 20px;
  margin-top: 5px;
}

.container {
  background: white;
  width: 70%;
  max-width: 800px;
  margin: 0 auto;
  border-radius: 4px;
  padding: 25px 30px 25px 25px;
  line-height: 20px;
  text-align: left;
}

.label {
  padding: 5px 5px 5px 0px;
  margin-top: 30px;
  font-size: 20px;
}

.input-field:focus {
  outline: none;
}

.input-field {
  border: none;
  border-bottom: 2px solid #E0E0E0;
  padding: 5px 5px 0px 0px;
  height: 35px;
  width: 300px;
  font-size: 16px;
}

.option {
  font-size: 16px;
}

#number {
  width: 140px;
}

#required {
  color: red;
}

#dropdown {
  height: 35px;
  width: 180px;
  border: none;
  background: white;
}

@media (max-width: 520px) {
  .input-field {
    width: 100%;
  }
}
              
            
!

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