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

              
                
<!-- position title outside of form -->
<h1 id="title">Survey</h1>
<!-- create form body -->
<div id="form-body">
  <p id="description">
    Please complete this short survey.
  </p>
  <form id="survey-form">
    <fieldset class="fieldset">
      <legend>Personal Information</legend>
    <div class="labels">
      <label id="name-label" for="name">Name: </label>
    </div>
    <div class="inputs">
      <input type="text" name="name" id="name" class="input-field" placeholder="Enter name" autofocus required>
    </div>
      <div class="labels">
        <label id="email-label" for="email">Email: </label>
      </div>
      <div class="inputs">
        <input type="email" name="email" id="email" class="input-field" placeholder="Enter email" required>
      </div>
      <div class="labels">
        <label id="number-label" for="age">Age: </label>
      </div>
      <div class="inputs">
        <input type="number" name="age" id="number" class="input-field" min="1" max="140" placeholder="Age" required>
      </div>
    </fieldset>
    <fieldset class="fieldset">
      <legend>Rate Your Experience</legend>
      <div class="labels">
        <label for="radio-buttons">Would you stay here again?</label>
        </div>
      <div class="inputs">
        <ul style="list-style-type:none;">
          <li class="radio"><label>Sure would!<input name="radio-buttons" value="1"  type="radio" class="userinput"></label></li>
          <li class="radio"><label>It depends<input name="radio-buttons" value="2" type="radio" class="userinput"></label></li>
          <li class="radio"><label>Not a chance in heck!<input name="radio-buttons" value="3" type="radio" class="userinput"></label></li>
        </ul>
        </div>
          <div class="labels">
            <label for="curte">Was the staff curteous?</label>
          </div>
      <div class="inputs">
        <ul style="list-style-type:none;">
          <li class="checkbox"><label>Very much so<input name="curte" value="1"  type="checkbox" class="userinput"></label></li>
          <li class="checkbox"><label>I have no opinion<input name="curte" value="2" type="checkbox" class="userinput"></label></li>
          <li class="checkbox"><label>Staff was terrible<input name="curte" value="3" type="checkbox" class="userinput"></label></li>
        </ul>
      </div>
    </fieldset>
    <fieldset class="fieldset">
      <legend>Misc. Information</legend>
      <div class="labels">
        <label for="misc">Would you recommend to a friend?</label>
      </div>
      <div class="inputs">
        <select id="dropdown" name="misc" class="dropdown">
          <option disabled selected value>Please Pick One</option>
          <option value="Yes">Yes</option>
          <option value="Maybe">Maybe</option>
          <option vale="No">No</option>
        </select>
      </div>
      <div class="labels">
        <label for="comments">Any comments?</label>
      </div>
      <div class="inputs">
        <textarea id="comments" class="input-field" name="commnents" style="height: 50px; resize: vertical;" placeholder="Add any comments here..."></textarea>
      </div>
    </fieldset>
    <button id="submit" type="submit">Submit</button>
    <button id="reset" type="reset">Reset Form</button>
  </form>
</div>
  
              
            
!

CSS

              
                * {
margin: 0;
padding: 0;
}
html,
body {
  background: #C866F7;
  text-align: center;
  font-family: Verdana, sans-serif;
}
h1 {
  padding: 10px;
}
#description {
  padding: 10px;
}
/* css for form body wrapper */
#form-body {
  background: #4DF5A3;
  width: 50%;
  max-width: 1000px;
  margin: auto;
  padding-top: 10px;
  padding: 5px;
  border: 1px solid;
  border-radius: 5px;
  box-shadow: 10px 10px 10px #C28F2A;
}
/* align labels and inputs */
.labels {
  display: inline-block;
  text-align: right;
  width: 40%;
  padding: 7px;
  vertical-align: top;
}
.inputs {
  display: inline-block;
  text-align: left;
  width: 48%;
  vertical-align: middle;
}
/* make input fiels uniform */
.input-field {
  height: 25px;
  width: 75%;
  padding: 3px;
  margin: 7px;
  border: 1px solid;
  border-radius: 2px;
}
.fieldset,
.buttons {
  text-align: left;
  padding: 5px;
  margin: 10px 5%
}
.userinput {
  float: left;
  margin-right: 5px
}
.radio, .checkbox {
  position: relative;
  margin: 7px;
}
#dropdown {
  height: 35px;
  width: 37%;
  padding: 5px;
  margin: 7px;
  border: 1px solid;
  border-radius: 2px;
}
.buttons {
  text-align: center;
}
#submit,
#reset {
  background-color: #59ace0;
  color: white;
  border-radius: 2px;
  border: 1px solid #59ace0;
  height: 35px;
  width:  100px;
  padding: 5px;
  margin: 7px;
}
#submit:hover,
#reset:hover {
  background-color: #C28F2A;
}
/* mobile responsiveness */
@media screen and (max-width: 600px) {
  #form-body {
    width: 80%
  }
  #dropdown {
    width: 100%
  }
  .labels {
    width: 100%;
    text-align: left;
  }
  .inputs {
    width: 80%;
    float: left;
  }
  .input-field {
    width: 100%;
  }
  select {
    width: 100%;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console