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

              
                    <div class="overlay"></div>
    <header>
      <h1 id="title">Survey Form</h1>
      <p id="description">Thank you for taking the time to fill this form</p>
    </header>

    <main>
      <form action="#" id="survey-form">
        <div class="form-group">
          <label id="name-label" class="form-label" for="name">Name</label>
          <input id="name" type="text" class="form-control" placeholder="Enter your name" required />
        </div>

        <div class="form-group">
          <label id="email-label" class="form-label" for="email">Email</label>
          <input id="email" type="email" class="form-control" placeholder="Enter your email" required />
        </div>

        <div class="form-group">
          <label id="number-label" class="form-label" for="number">Age <span class="clue">(optional)</span></label>
          <input id="number" type="number" class="form-control" placeholder="Age" min="12" max="120" />
        </div>

        <div class="form-group">
          <label class="form-label">Which option best describes your current role?</label>
          <select name="role" id="dropdown" class="form-control" required>
            <option disabled selected value>Select current role</option>
            <option value="student">Student</option>
            <option value="full-time-job">Full-time Job</option>
            <option value="full-time-learner">Full-time Learner</option>
            <option value="prefer-not-to-say">Prefer not to say</option>
            <option value="other">Other</option>
          </select>
        </div>
        <div class="form-group radio-group">
          <label class="radio-label">Would you recommend this platform to a friend?</label>
          <label for="definitely">
            <input type="radio" name="recommend" id="definitely" class="input-radio" value="definitely" checked />
            Definitely
          </label>
          <label for="maybe">
            <input type="radio" name="recommend" id="maybe" class="input-radio" value="maybe" /> Maybe
          </label>
          <label for="notSure">
            <input type="radio" name="recommend" id="notSure" class="input-radio" value="not-sure" /> Not sure
          </label>
        </div>

        <div class="form-group">
          <label class="check-label">What would you like to see improved? <span>(Check all that apply)</span></label>
          <div class="check-group">
            <label for="frontEnd">
              <input type="checkbox" class="input-check" name="prefer" id="frontEnd" value="front-end-project" />
              Front-end Project
            </label>
            <label for="backEnd">
              <input type="checkbox" class="input-check" name="prefer" id="backEnd" value="back-end-project" />
              Back-end Project
            </label>
            <label for="dataVisualization">
              <input
                type="checkbox"
                class="input-check"
                name="prefer"
                id="dataVisualization"
                value="data-visualization"
              />
              Data Visualization
            </label>
            <label for="challenges">
              <input type="checkbox" class="input-check" name="prefer" id="challenges" value="challenges" /> Challenges
            </label>
            <label for="open-source-community">
              <input
                type="checkbox"
                class="input-check"
                name="prefer"
                id="open-source-community"
                value="open-source-community"
              />
              Open Source Community
            </label>
            <label for="gitter">
              <input type="checkbox" class="input-check" name="prefer" id="gitter" value="gitter-help-rooms" />
              Gitter Help Rooms
            </label>
            <label for="videos">
              <input type="checkbox" class="input-check" name="prefer" id="videos" value="videos" /> Videos
            </label>
            <label for="city">
              <input type="checkbox" class="input-check" name="prefer" id="city" value="city-meetups" /> City Meetups
            </label>
            <label for="wiki">
              <input type="checkbox" class="input-check" name="prefer" id="wiki" value="wiki" /> Wiki
            </label>
            <label for="forum">
              <input type="checkbox" class="input-check" name="prefer" id="forum" value="forum" /> Forum
            </label>
            <label for="courses">
              <input type="checkbox" class="input-check" name="prefer" id="courses" value="additional-courses" />
              Additional Courses
            </label>
          </div>
        </div>
        <div class="form-group">
          <label class="form-label">Any comments or suggestions?</label>
          <textarea
            name="comments"
            id="comments"
            cols="30"
            rows="10"
            placeholder="Enter your comment here..."
          ></textarea>
        </div>
        <button type="submit" id="submit">Submit</button>
      </form>
    </main>

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

<!-- 

Hello Camper!

For now, the test suite only works in Chrome! Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding! 

- The freeCodeCamp Team 

-->

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Grandstander:wght@300;400;700&display=swap');

html {
  font-family: 'Grandstander', cursive;
}

*,
*::after,
*::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.overlay {
  background: url('https://images.pexels.com/photos/3194519/pexels-photo-3194519.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500');
  background-size: cover;
  z-index: -1;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
}

.overlay::after {
  content: ' ';
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: rgba(1, 11, 105, 0.6);
  z-index: 1;
}

header {
  text-align: center;
  margin: 1rem 0;
  color: #fff;
}

header #title {
  margin-bottom: 0.4rem;
}

main {
  max-width: 560px;
  background: rgba(0, 0, 0, 0.8);
  padding: 1rem;
  margin: 0 auto;
  border-radius: 5px;
}

@media screen and (max-width: 575px) {
  main {
    max-width: 95vw;
  }
}

.form-group {
  margin-bottom: 1rem;
}

label {
  padding-left: 0.05rem;
  display: block;
  color: #fff;
}

.check-group label[for],
.radio-group label[for] {
  padding: 0.5rem 0 0 0.05rem;
}

.form-label {
  margin-bottom: 0.3rem;
}

.radio-label,
.check-label {
  margin-bottom: 0;
}

.form-control {
  display: block;
  width: 100%;
  height: 1.75rem;
  padding-left: 5px;
}

.check-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.input-radio,
.input-check {
  cursor: pointer;
}

label span {
  font-size: 0.8rem;
}

#comments {
  width: 100%;
  padding: 0.4rem;
  font-family: 'Grandstander', cursive;
}

#submit {
  width: 100%;
  font-size: 1.1rem;
  padding: 0.5rem;
  height: 2.5rem;
  cursor: pointer;
  color: #fff;
  background-color: #243a9c;
  border-radius: 5px;
  border-top: 2px solid #5052eb;
  border-left: 2px solid #5052eb;
  border-bottom: 2px solid #0d146b;
  border-right: 2px solid #0d146b;
}

#submit:hover,
#submit:focus {
  background-color: #2945c4;
  outline: none;
}

#submit:active {
  background-color: #3655dd;
  border-bottom: 2px solid #5052eb;
  border-right: 2px solid #5052eb;
  border-top: 2px solid #0d146b;
  border-left: 2px solid #0d146b;
}

              
            
!

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