css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              
<h1 id="title">Survey Form</h1>
<div id="form-box">
  <p id="description">Let us know how we can improve freeCodeCamp</p>
  <form id="survey-form">
    <div class="labels">
      <label for="name" id="name-label">Name:</label>
    </div>
    <div class="input">
      <input type="text" id="name" class="input_field" name="name" placeholder="Enter your name" required>
    </div>
    <div class="labels">
      <label for="email" id="email-label">Email:</label>
    </div>
    <div class="input">
      <input type="email" id="email" class="input_field" name="email" placeholder="Enter your Email" required>
    </div>
    <div class="labels">
      <label for="age" id="number-label">Age:</label>
    </div>
    <div class="input">
      <input type="number" id="number" class="input_field" name="age" min="6" max="100" placeholder="Enter your age">
    </div>
    <div class="labels">
      <label for="role">Which option best describes your current role?</label>
    </div>
    <div class="input">
      <select name="role" id="dropdown">
        <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="labels" id="radio-label">
      <label for="would_recommend">How likely is that you would recommend freeCodeCamp to a friend?</label>
    </div>
    <div class="input">
    <ul style="list-style: none;">
          <li class="radio"><label><input name="radio-buttons" value="1"  type="radio" class="userRatings" >Definitely</label></li>
          <li class="radio"><label><input name="radio-buttons" value="2"  type="radio" class="userRatings" >Maybe</label></li>
          <li class="radio"><label><input name="radio-buttons" value="3"  type="radio" class="userRatings" >Not sure</label></li>
        </ul>
    </div>
    <div class="labels" id="chkbox-label">
      <label for="would_recommend">Things that should be improved in the future <br> (Check all that apply):</label>
    </div>
    <div class="input">
    <ul style="list-style-type:none" id="would_recommend"> 
      <li class="radio"><label><input name="radio-buttons" value="1"  type="checkbox" class="userRatings" >Front-end Projects</label></li>
      <li class="radio"><label><input name="radio-buttons" value="2"  type="checkbox" class="userRatings" >Back-end Projects</label></li>
      <li class="radio"><label><input name="radio-buttons" value="3"  type="checkbox" class="userRatings" >Data Visualization</label></li>
      <li class="radio"><label><input name="radio-buttons" value="4"  type="checkbox" class="userRatings" >Other</label></li>
    <ul>
    </div>
    <div class="labels">
      <label for="comments" id="form-label">Any Comments or Suggestions?</label>
    </div>
    <div class="input">
      <textarea id="comments" rows="4" cols="23" placeholder="Enter you comments here..."></textarea>
    </div>
    <button type="submit" id="submit">Submit</button>
  </form>
</div>
            
          
!
            
              body{
  background-color: gray; 
  text-align: center;
}

#form-box{
  background-color: white;
  border: 1px;
  border-radius: 5px;
  margin: auto;
  padding: 5px;
  max-width: 1000px;
  box-shadow: 5px 5px 20px black;
}

.labels{
  display: inline-block;
  width: 44%;
  text-align: right;
  vertical-align: top;
  padding: 5px;
}

.input{
  display: inline-block;
  width: 53%;
  text-align: left;
  vertical-align: middle;
  padding: 5px;
}

#radio-label{
  padding-top: 18px;
}

#chkbox-label{
  padding-top: 18px;
}

.input_field{
  width:200px;
}

@media screen and (max-width: 900px){
  .input{
  width: 100%;
  float: left;
  }
  
  .labels{
  width: 100%;
  text-align: left;
  }
  
}

            
          
!
            
              // coded by @SamAI-Software
const projectName = 'survey-form';
localStorage.setItem('example_project', 'Survey Form');
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console