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

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

<h1 id="title">Survey Form</h1>

<div id="container">
  <p id="description">Fill out the form</p>

  <form id="survey-form">
    <div class="rowTab">
      <label for="name" id="name-label">* Name:</label>
      <div class="rightTab">
        <input type="text" name="name" id="name" placeholder="Enter your name" class="width-70" required/>
      </div>
    </div>

    <div class="rowTab">
      <label for="email" id="email-label">* Email:</label>
      <div class="rightTab">
        <input type="email" name="email" id="email" placeholder="Enter your email" class="width-70" required/>
      </div>
    </div>

    <div class="rowTab">
      <label for="age" id="number-label">* Age:</label>
      <div class="rightTab">
        <input type="number" name="age" id="number" placeholder="Enter your age" max="125" min="1" class="width-70" required/>
      </div>
    </div>

    <div class="rowTab">
      <label for="dropdown" id="dropdown-label">Pick a color:</label>
      <div class="rightTab">
        <select id="dropdown" name="color" class="width-70">
          <option disabled value="">Select a color</option>
          <option value="red" selected>Red</option>
          <option value="blue">Blue</option>
          <option value="green">Green</option>
          <option value="yellow">Yellow</option>
          <option value="n/a">No favorite color</option>
        </select>
      </div>
    </div>

    <div class="rowTab">
      <label>Gender:</label>
      <div class="rightTab">
        <ul>
          <li class="radio">
            <label> Male
              <input type="radio" name="gender" value="m" id="gender-m"/> 
            </label>
          </li>
          <li class="radio">
            <label> Female
              <input type="radio" name="gender" value="f" id="gender-f"/> 
            </label>
          </li>
          <li class="radio">
            <label> Non-binary
              <input type="radio" name="gender" value="nb" id="gender-nb"/> 
            </label>
          </li>
      </div>
    </div>

    <div class="rowTab">
      <label>Select favorite animals:</label>
      <div class="rightTab">
        <ul>
          <li class="radio">
            <label> Cat
              <input type="checkbox" name="animal" value="cat"/> 
            </label>
          </li>
          <li class="radio">
            <label> Dog
              <input type="checkbox" name="animal" value="dog"/> 
            </label>
          </li>
          <li class="radio">
            <label> Rabbit
              <input type="checkbox" name="animal" value="rabbit"/> 
            </label>
          </li>
          <li class="radio">
            <label> Parrot
              <input type="checkbox" name="animal" value="parrot"/> 
            </label>
          </li>
        </ul>
      </div>
    </div>

    <div class="rowTab">
      <label for="comments" id="comments-label">Questions/Comments:</label>
      <div class="rightTab">
        <textarea class='width-70' placeholder="Questions or Comments"></textarea>
      </div>
    </div>
      
    <input type="submit" id="submit" value="Submit Form"/>
  </form>
</div>
              
            
!

CSS

              
                body
  background-color: #9cf
  text-align: center
  
#container
  width: 55%
  min-width: 900px
  margin: auto
  background-color: rgb(250,250,250)
  border-radius: 5px
  box-shadow: 0 0 5px #ccc
  padding: 10px

.rowTab
  display: flex
  
.rowTab label, .rowTab .rightTab
  flex: 1 1 50%
  padding: 10px

.rowTab > label
  text-align: right
  line-height: 40px
  margin: 0

.rowTab .rightTab
  text-align: left
  
.rowTab .rightTab .width-70
  width: 70%
  
select, input, textarea
  border: 1px solid #c0c0c0
  border-radius: 3px

.rowTab .rightTab input, .rowTab .rightTab select
  padding: 10px
  
select
    height: 35px
    width: 140px
    padding: 5px

.rowTab .rightTab input[type='radio'], .rowTab .rightTab input[type='checkbox']
  float: left
  margin: 4px
  
.rightTab ul
  list-style: none
  margin: 0
  padding: 0

.rightTab ul li.radio
  position: relative
  left: -5px
  display: block

.rightTab ul li.radio label
  margin: 0
  padding: 5px

textarea
  height: 100px
  padding: 5px
  
#submit
  width: 90%
  background-color: darkgreen
  color: #fff
  line-height: 45px
  font-size: 1.5em
  cursor: pointer
              
            
!

JS

              
                
              
            
!
999px

Console