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

              
                <div id="wrap"></div>
<main>
  <h1 id="title">freeCodeCamp Survey Form</h1>
  <p id="description">Thank you for taking the time to help us improve the platform</p>
  <div id="container">
    <form id="survey-form">
      <div class="group">
        <label id="name-label" for="name">Name</label>
        <input type="text" id="name" name="name" placeholder="Enter your name" required>
      </div>
      
      <div class="group">
        <label id="email-label" for="email">Email</label>
        <input type="email" id="email" name="email" placeholder="Enter your Email" required>
      </div>
      
      <div class="group">
        <label id="number-label" for="number">Age <small>(optional)</small></label>
        <input type="number" id="number" name="number" placeholder="Age" min="10" max="99">
      </div>
      
      <div class="group">
        <p>Which option best describes your current role?</p>
        <select name="role" id="dropdown">
          <option value="" disabled selected>Select current role</option>
          <option value="student">Student</option>
          <option value="full-time-job">Full Time Job</option>
        </select>
      </div>
      
      <div class="group">
        <p>Would you recommend freeCodeCamp to a friend?</p>
        <label>
        <input id="recommend-definitely" type="radio" name="recommend" value="definitely">         Definitely</label>

        <label>
        <input id="recommend-maybe" type="radio" name="recommend" value="maybe"> Maybe</label>

        <label>
        <input id="recommend-not-sure" type="radio" name="recommend" value="not-sure"> Not sure</label>
      </div>
      
      <div class="group">
        <p>What would you like to see improved? <small>(Check all that apply)</small></p>
        
        <label>
          <input type="checkbox" value="frontend-projects" name="frontend-projects" id="checkbox-frontend-projects"> Front-end Projects</label>
          
        <label>
                    <input type="checkbox" value="backend-projects" name="backend-projects" id="checkbox-backend-projects"> Back-end Projects</label>
          
        <label>
                    <input type="checkbox" value="data-visualization" name="data-visualization" id="checkbox-data-visualization"> Data Visualization</label>
      </div>
      
      <div class="group">
        <label for="comments">Any comments or suggestions?</label>
        <textarea id="comments" rows="6" placeholder="Enter your comment here..."></textarea>
      </div>
      
      <button type="submit" id="submit">Submit</button>
      
    </form>
  </div>
</main>
              
            
!

CSS

              
                body {
  color: white;
  background-image: url('https://cdn.freecodecamp.org/testable-projects-fcc/images/survey-form-background.jpeg');
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  text-align: center;
  font-family: 'Poppins', sans-serif;
}

#wrap {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0; 
  left: 0;
  height: 100vh;
  z-index: -1;
  background-image: linear-gradient(
    to bottom,
    rgba(80, 80, 150, 0.7),
    rgba(80, 80, 150, 0.3)
  );
}

h1 {
  font-size: 2em;
  margin-top: 2em;
}

#description {
  padding: 10px;
  font-size: 120%;
  font-weight: lighter;
  font-style: italic;
}

#container {
  background-color: rgba(27, 27, 50, 0.8);
  width: 80%;
  max-width: 700px;
  margin: 1em auto;
  box-sizing: border-box;
  border-radius: 5px;
  padding: 25px;
  text-align: left;
}

#survey-form {
  font-size: 115%;
}

@media (max-width: 640px) {
  #container {
    width: 90%;
  }
  
  #survey-form {
    font-size: 90%;
  }
}

label {
  display: block;
}

small {
  font-size: 75%;
}

input, select, textarea, button {
  box-sizing: border-box;
  margin: 10px 0;
  padding: 8px;
  border-radius: 2px;
  border-style: none;
  font-size: 95%;
  font-family: 'Poppins', sans-serif;
}

input[type="text"],
input[type="number"],
input[type="email"],
button,
select,
textarea
{
  width: 100%;
}

input[type="checkbox"],
input[type="radio"]{
  transform: scale(1.6);
  margin: 15px 10px 0 5px;
}

#survey-form .group {
  margin-bottom: 25px;
}

button {
  background-color: rgb(55, 175, 101);
  color: white;
}

button:hover, button:focus {
  animation-name: hover;
  animation-duration: 0.35s;
  animation-fill-mode: forwards;
}

@keyframes hover {      
  100% {
    transform: scale(1.03);
  }
}

              
            
!

JS

              
                            
              
            
!
999px

Console