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

              
                <!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>Survey Form</title>
  <link rel="stylesheet" href="stylesheet.css" type="text/css">
  </head>
  <body>

    <h1 id="title">Survey Form</h1>
      <div class="form-outer-container">

        <p id="description">
       Help me get to know you better.
       </p>

       <form id="survey-form" action="#" method="#">
        <div class="row">
          <div class="left-column">
            <label id="name-label" for="name">* Name: </label>
          </div>
          <div class="right-column">
            <input autofocus type="text" name="name" id="name" class="input-field" placeholder="Enter your Name" required>
          </div>
        </div>

        <div class="row">
          <div class="left-column">
            <label id="email-label" for="email">* Email: </label>
          </div>
          <div class="right-column">
            <input type="email" name="email" id="email" class="input-field" required placeholder="Enter your Email">
          </div>
        </div>
        <div class="row">
          <div class="left-column">
            <label id="number-label" for="age">* Age: </label>
          </div>
          <div class="right-column">
            <input type="number" name="age" id="number" min="1" max="125" class="input-field" placeholder="Age">
          </div>
        </div>
        <div class="row">
          <div class="left-column">
           <label for="relation">How do you know me?</label>
          </div>
          <div class="right-column">
            <select id="dropdown" name="relation" class="dropdown">
             <option disabled value>Select an option</option>
             <option value="family">Family</option>
             <option value="colleague">Colleague</option>
             <option value="friend">Friend</option>
             <option value="acquaintance">Acquaintance</option>
             <option value="other">Other</option>
           </select>
          </div>
        </div>

        <div class="row">
          <div class="left-column">
            <label for="time">How long have we known each other?</label>
          </div>
          <div class="right-column">
            <ul style="list-style: none;">
              <li class="radio"><label>Less than 1 year<input name="radio-buttons" value="1"  type="radio" class="userRatings" ></label></li>
              <li class="radio"><label>1-2 years<input name="radio-buttons" value="2"  type="radio" class="userRatings" ></label></li>
              <li class="radio"><label>3-5 years<input name="radio-buttons" value="3"  type="radio" class="userRatings" ></label></li>
              <li class="radio"><label>More than 5 years<input name="radio-buttons" value="4"  type="radio" class="userRatings" ></label></li>
            </ul>
           </div>
          </div>
          <div class="row">
           <div class="left-column">
             <label for="activity">What kind of activity would you like to do together?<br>(Check all that apply): </label>
           </div>
           <div class="right-column">
             <ul id="activity" style="list-style: none;">
               <li class="checkbox"><label><input name="activity" value="1" type="checkbox" class="userRatings">Hiking</label></li>
               <li class="checkbox"><input name="activity" value="2" type="checkbox" class="userRatings">Going to the cinema</li>
               <li class="checkbox"><label><input name="activity" value="3" type="checkbox" class="userRatings">Cooking</label></li>
               <li class="checkbox"><label><input name="activity" value="4" type="checkbox" class="userRatings">Photo walks</label></li>
               <li class="checkbox"><label><input name="activity" value="5" type="checkbox" class="userRatings">Going to events, concerts etc.</label></li>
               <li class="checkbox"><label><input name="activity" value="6" type="checkbox" class="userRatings">Going to museums</label></li>
             </ul>
           </div>
          </div>
          <div class="row">
           <div class="left-column">
              <label for="comments">Any comment or message?</label>
           </div>
           <div class="right-column">
             <textarea id="comments" class="input-field" style="height:50px;resize:vertical;" name="comment" placeholder="Leave your message here..."></textarea>
           </div>
          </div>
       <button id="submit" type="submit">Submit</button>
     </form>
    </div> <!-- .form-outer-container -->

</body>
</html>

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Lato|Raleway&display=swap');

html, body {
background-color: #96e09d;
font-family: "Raleway", Helvetica, sans-serif;
min-width: 320px:
}

h1 {
text-align: center;
font-family: "Lato";
}

.form-outer-container {
  background-color: #FFF;
  margin: 15px auto;
  padding: 10px 20px;
  border-radius: 8px;
  max-width: 600px;
  display: block;
  width: 70%;
}

#description {
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
}

.userRatings,
input[type="checkbox"] {
  float: left;
}

.left-column {
  width: 45%;
  display: inline-block;
  text-align: right;
  padding-right: 10px;
  vertical-align: top;
}

.right-column {
  width: 45%;
  display: inline-block;
  text-align: left;
  padding-left: 10px;
  vertical-align: top;
}

ul {
  list-style-position: inside;
  padding-left: 0;
  padding-top: 0;
  margin:0;
}

.row {
  margin-top: 10px;
}


.input-field {
  height: 20px;
  width: 250px;
  padding: 5px;
  margin: 0;
  border: 1px solid #c0c0c0;
  border-radius: 2px;

}


#submit {
  display: block;
  text-align: center;
  padding: 10px 20px;
  margin: 10px auto;
  background-color: #2E8B57;
  border-radius: 10px;
  weight: 500;
  font-size: 1em;
}

@media screen and (max-width: 800px) {
  .row {
    text-align: center;
  }
  .left-column {
    width: 80%;
    text-align: left;
    margin: 5px 0px;
  }
  .right-column {
    width: 80%;
  }
  .input-field {
    width: 80%;
  }
  select {
    width: 80%;
  }
}

@media screen and (max-width: 500px) {
  .row {
    text-align: center;
  }
  .left-column {
    width: 80%;
    text-align: left;
    margin: 5px 0px;
  }
  .right-column {
    width: 80%;
  }
  .input-field {
    width: 100%;
  }
  select {
    width: 80%;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console