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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

              
                <div id="main">
  <h1 id="title">
    Customer Satisfaction Survey
  </h1>
  <p id="description">
    <em>Please help us by completing this short survey</em>
  </p>
  <form id="survey-form" class="f1" action="">
    
    <label for="name" id="name-label">Name</label>
      <input type="text" id="name" placeholder="Enter Name....." required> 
    <label for="email" id="email-label">Email</label>
    <input type="email" id="email" placeholder="Enter Email....." required>
    <label for="number" id="number-label">Age <small>(optional)</small></label>
    <input type="number" id="number" placeholder="Enter Age....." min="16" max="110">
    
    <label for="dropdown">Would you recommend us?</label>
    <select id="dropdown">
      <option value="">Select an option</option>
      <option value="Not likely">Not Likely</option>
      <option value="Maybe">Maybe</option>
      <option value="Very likely">Very Likely
    </select>
    
    <p class="radcheck-p">Would you like to receive future offers from us?</p>
    <input type="radio" class="radios r1" name="future-offers" value="yes">
    <label for="">Yes</label><br>
    <input type="radio" class="radios r2" name="future-offers" value="no">
     <label for="">No</label>
    
   <p class="radcheck-p"> How would you like us to contact you?</p>
 <label for="post"><input type="checkbox" name="contact-pref" value="post" id="post" class="c1"> Post</label><br>
    
  <label for="emails"><input type="checkbox" name="contact-pref" value="email" id="emails" class="c1"> Email</label><br>
    
<label for="tele"><input type="checkbox" name="contact-pref" value="telephone" id="tele" class="c1"> Telephone</label><br>
    
    <label for="comments"><p class="comment-p">Extra comments or suggestions below</p></label>
    <textarea id="comments" placeholder="Comments.."></textarea>
    
    <button type="submit" id="submit">
      Submit
    </button
  </form>
</div>
              
            
!

CSS

              
                #main, #survey-form, #name, #email, #number, #dropdown, #submit, textarea {
  box-sizing:border-box;
}
body {
  margin:0;
  background:black;
}
#main {  background:url(https://media.istockphoto.com/photos/blue-bokeh-background-picture-id628358422?k=20&m=628358422&s=612x612&w=0&h=PZoz58yoO4-BUMeJLcaQvDOO3zO2ObHmjvWUfMAdFNY=);
  background-size:cover;
  color:white;
  padding:20px 20px 40px 20px;
  font-family:verdana,arial;
}
#title {
  text-align:center;
  padding:0px 20px;
} 
#description {
  text-align:center;
  padding:0px 20px 6vh 20px;
  font:600 18px verdana;
}
#survey-form {
  background:linear-gradient(darkorange,red,darkorange); 
  border-radius:8px;
  width:60vw;
  margin:auto;
  padding:4% 7% 4% 7%;
  font-size:1rem;
  
}
#name, #email, #number {
  width:100%;
  height:2.3rem;
  margin:.75rem 0px 1.4rem 0px;
  border-radius:5px;
  padding-left:10px;
  font-size:.9rem;
}
#dropdown {
  width:100%;
  padding:.5rem 0px .5rem 10px;
  margin:.75rem 0px .4rem 0px;
  border-radius:5px;
  font-size:.9rem;
}
.radcheck-p {
  margin: 1.5rem 0px .5rem 0px;
}
.comment-p {
  margin-top:1.9rem
}

textarea {
  width:100%;
  height:100px;
  border-radius:5px;
  padding:5px 0px 0px 10px;
  font-size:1rem;
}

#submit {
  margin:2rem auto 1rem auto;
  background:darkblue;
  color:white;
  width:100%;
  padding:7px;
  font-size:1.2rem;
  border-radius:5px;
}
#submit:hover {
  background:rgba(0,155,0,0.8);
  box-shadow:0px 0px 3px 1px white;
}
@media (min-width:551px) and (max-width:800px) {
  #survey-form {
    width:80%
  }
}
@media (max-width:550px) {
  #survey-form {
    width:96%;
  }
  #main {
    padding:30px 0px 0px 0px;
  }
}
              
            
!

JS

              
                // !! IMPORTANT README:

// You may add additional external JS and CSS as needed to complete the project, however the current external resource MUST remain in place for the tests to work. BABEL must also be left in place. 

/***********
INSTRUCTIONS:
  - Select the project you would 
    like to complete from the dropdown 
    menu.
  - Click the "RUN TESTS" button to
    run the tests against the blank 
    pen.
  - Click the "TESTS" button to see 
    the individual test cases. 
    (should all be failing at first)
  - Start coding! As you fulfill each
    test case, you will see them go   
    from red to green.
  - As you start to build out your 
    project, when tests are failing, 
    you should get helpful errors 
    along the way!
    ************/

// PLEASE NOTE: Adding global style rules using the * selector, or by adding rules to body {..} or html {..}, or to all elements within body or html, i.e. h1 {..}, has the potential to pollute the test suite's CSS. Try adding: * { color: red }, for a quick example!

// Once you have read the above messages, you can delete all comments. 

              
            
!
999px

Console