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

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

<p id="description"> Short survey to discover best ways to code! </p>

<form id="survey-form">
<div class="leftTab">
  <label for="name" id="name-label"> * Name: </label>
  </div>
  <div class="rightTab">
  <input id="name" autofocus type="text" required placeholder="Enter your name" name="name">
    <div class="leftTab">
  <label for="email" id="email-label"> * Email: </label>
  </div>
<div class="rightTab">
  <input id="email" type="email" required placeholder="Enter your email" name="email">
  </div>
  <div class="leftTab">
  <label for="number" id="number-label"> * Age: </label>
  </div>
  <div class="rightTab">
  <input id="number" type="number" placeholder="Age" name="age" min="1" max="110">
  </div>
  <div class="leftTab"
  <label for="dropdown" class="emp-status"> Employment Status:</label>
</div>
<div class="rightTab">
  <select id="dropdown">
        <option disabled value> Employment Status </option>
        <option value = "Unemployed"> Unemployed </option>
        <option value = "Employed"> Employed </option>
        <option value = "Self-Employed"> Self-Employed </option>
        <option value = "Full-Time Education"> Full-Time Education </option>
        <option value = "Part-Time Education"> Part-Time Education </option>
        <option value = "Retired"> Retired </option>
        <option value = "Other"> Other </option>
 </div>
  <div class="leftTab">
    <label for="gender">Gender:</label>
  </div>
  <div class="rightTab">
     <ul id="gender">
      <li class = "radio"> Male <input name = "radio-buttons" value = "1" type = "radio" class = "mfGender"></li>
    <li class = "radio"> Female <input name = "radio-buttons" value = "2" type = "radio" class = "mfGender"></li>
    </ul>
    </div>
    <div class="leftTab">
     <label for="best" class="best-label">What do you think makes it easier to learn to code<br>(Mark all that apply):</label>
  </div>
  <div class="rightTab">
      <ul id = "best">
        <li class = "checkbox">
        <input name = "best" value = "1" type = "checkbox" class = "user-choice">Learning alone</li>
      <li class = "checkbox">
        <input name = "best" value = "2" type = "checkbox" class = "user-choice">Learning with a mentor</li>
      <li class = "checkbox">
        <input name = "best" value = "3" type = "checkbox" class = "user-choice">Facebook Groups</li>
      <li class = "checkbox">
        <input name = "best" value = "4" type = "checkbox" class = "user-choice">Youtube lectures</li>
      <li class = "checkbox">
        <input name = "best" value = "5" type = "checkbox" class = "user-choice">Free online Schools</li>
        <li class = "checkbox">
          <input name = "best" value = "6" type = "checkbox" class = "user-choice">Paid online Schools</li>
      <li class = "checkbox">
        <input name = "best" value = "7" type = "checkbox" class = "user-choice">Search Engines</li>
      <li class = "checkbox">
        <input name = "best" value = "8" type = "checkbox" class = "user-choice">Meetups</li>
      <li class = "checkbox">
        <input name = "best" value = "9" type = "checkbox" class = "user-choice">Trial and error</li>
      <li class = "checkbox">
        <input name = "best" value = "10" type = "checkbox" class = "user-choice">Books</li>
      <li class = "checkbox">
        <input name = "best" value = "11" type = "checkbox" class = "user-choice">Forums</li>
    </ul>
    </div>
  <div class="leftTab">
        <label for = "comments">Any Comments or Suggestions?</label>
  </div>
  <div class="rightTab">
        <textarea id = "comments" class = "input-field" name = "comments" rows = "6" cols = "50" maxlength = "500" placeholder = "Enter your comments here..."></textarea>
 
    <button id = "submit" type = "submit">Submit</button>
    
<div id="checkboxes">
  <label>some label</label>
  <ul>
    <li><input type="checkbox"> checkbox 1</li>
    <li><input type="checkbox"> checkbox 2</li>
    <li><input type="checkbox"> checkbox 3</li>
    <li><input type="checkbox"> checkbox 4</li>
  </ul>
</div>
</form>
              
            
!

CSS

              
                body {
  width: 100%;
  height: 100%;
  background: linear-gradient(150deg, blue, green 30%, red);
  text-align: center;
}
#title {
  font-size: 50px;
  font-family: fantasy;
}
#description {
  font-size: 20px;
  font-family: monospace;
}
.leftTab {
  virtical-align: top;
  float: left;
  border-style: dotted;
}
.rightTab {
  vertical-align: top;
  border-style: dotted;
  color: red;
}
#number {
  width: 45px;
}
.radio, .checkbox {
  display: inline;
}
#dropdown {
  height: 25px;
  width: 160px;
  padding: 2px;
  margin: 2px;
  border: 1px solid #c0c0c0;
  border-radius: 2px;
}
.checkbox {
  position: relative;
  top: 30px;
  left: -12px;
  margin-left: 10px;
  display: block;
  padding-bottom: 10px;
}
.input-field {
  position: relative;
  top: 10px;
  height: 50px;
  width: 200px;
  padding: 5px;
  margin: 4px;
  border: 2px solid #c0c0c0;
  border-radius: 2px;
}
#submit {
  background-color: white;
  border-radius: 5px;
  color: blue;
  font-size: 1em;
  height: 40px;
  width: 90px;
  margin: 10px;
  border: 2px solid;
  position: relative;
  top: 50px;
  right: 130px
}
#checkboxes label {
  float: left;
}
#checkboxes ul {
  margin: 0;
  list-style: ;
  float: left;
}
              
            
!

JS

              
                
              
            
!
999px

Console