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

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<html>
  <head>
 <link href="https://fonts.googleapis.com/css?family=Libre+Baskerville&display=swap" rel="stylesheet">
  </head>
  <body>
  <div class="container">
 <header class="header">
    <h1 id="title"> Dumela Fresh! Survey Form </h>
    <p id="description"> Thank you for taking the time to help us improve our service. </p>
    </header>
    
<form id="survey-form">
  <div class="form-container">
  <label id="name-label" for="name">Name</label>
  <input 
         type="text" 
         id="name"
         name="name"
         class="form-control"
         placeholder="Enter your name" 
         required />
 </div>
  <div class="form-container">
  <label id="email-label" for="email">Email</label>
  <input
         type="email"
         id="email"
         name="email"
         class="form-control"
         placeholder="Enter your email"
         required />
</div> 
  
<div class="form-container">
  <label id="number-label" for="number">How many people are in your household?</label>
  <input
         type="number"
         id="number"
         name="household-number"
         min="1"
         max="10"
         class="form-control"
         placeholder="(1-10)"
         required />
  </div>
  
<div class="form-container">
<p>How many meals do you eat out per week?</p>
<select id="dropdown" class="form-control" for="eatout" required>
  <option disabled selected value>Select range</option>
  <option value="0-2">0-2</option>
  <option value="3-5">3-5</option>
  <option value="6-8">6-8</option>
  <option value="9+">9+</option>
    </select>
 </div>
  
<div class="form-container">
  <label id="interest" for="interest">Would you use a grocery delivery service?</label> 
  <label>
  <input
         id="interest"
         type="radio"
         name="user-interest"
         value="definitely"
         class="input-radio"
         />Definitely</label>
 <label>
   <input
         id="interest"
         type="radio"
         name="user-interest"
         value="maybe"
         class="input-radio"
         />Maybe</label>   
 <label>
   <input
         id="interest"
         type="radio"
         name="user-interest"
         value="no"
         class="input-radio"
         />No</label>
<label>
  <input
         id="interest"
         type="radio"
         name="user-interest"
         value="not sure"
         class="input-radio"
         />Not Sure</label>
  </div>
    
<div class="form-container">
    <p> Where do you buy your groceries? </p>
<label>
  <input
         type="checkbox"
         name="preferred"
         value="Checkers"
         class="input-checkbox"
         />Checkers</label>
<label>
  <input
         type="checkbox"
         name="preferred"
         value="Choppies"
         class="input-checkbox"
         />Choppies</label>
<label>
  <input
         type="checkbox"
         name="preferred"
         value="PicknPay"
         class="input-checkbox"
         />PicknPay</label>
<label>
  <input
         type="checkbox"
         name="preferred"
         value="Sefalana"
         class="input-checkbox"
         />Sefalana</label>
<label>
  <input
         type="checkbox"
         name="preferred"
         value="Shoprite"
         class="input-checkbox"
         />Shoprite</label>
<label>
  <input
         type="checkbox"
         name="preferred"
         value="Spar"
         class="input-checkbox"
         />Spar</label>
<label>
  <input
         type="checkbox"
         name="preferred"
         value="Woolworths"
         class="input-checkbox"
         />Woolworths</label>
<label>
  <input
         type="checkbox"
         name="preferred"
         value="Other"
         class="input-checkbox"
         />Other</label>
  <input
         type="text"
         placeholder="(please specify)"
         id="other-specify"
         </input>
    </div>

<div class="form-container">
    <p> Any comments or suggestions to improve our service?</p>
    <textarea
              id="comments"
              name="comment"
              class="input-textarea"
              placeholder="(optional)"
              ></textarea>
  </div>

<div class="form-container">
    <button type="submit" id="submit" class="submit-button">Submit</button>
      </div>
     </form>
    </div>
   </body>
</html>
              
            
!

CSS

              
                body {
  margin: 0;
  background-image: url(https://images.unsplash.com/photo-1516594798947-e65505dbb29d?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80);
  background-size: cover;
  background-position: left;
  font-size: 1rem;
  font-weight: 400; 
  font-family: 'Libre Baskerville', serif;
  color: white;
}

.header {
 text-align: center;
 background: green;
 margin: auto 25%;
 }

#title {
  padding-top: 15px;
  font-weight: 200;
}

#description {
  font-style: italic;
  justify-content: center;
  padding-top: 15px;
  padding-bottom: 15px;
  font-weight: 200;
    }


p {
  margin: 0;
  display: flex; 
  padding-bottom: 10px;
  font-size: 1.125rem;
}

label {
  display: flex;
  padding-bottom: 10px;
  font-size: 1.125rem;
}


.form-container {
  background-color: green;
  margin: auto 25%;
  padding: 35px 35px 0px 35px;
}

.form-control {
  width: 100%; 
  height: 2.375rem;
  border-radius: 0.25rem;
  font-family: inherit;
       }

#other-specify {
  width: 25%;
  height: 1.5rem;
  font-family: inherit;
}

.input-textarea {
  height: 120px;
  width: 100%;
  resize: vertical;
  font-family: inherit;
}

.submit-button {
  display: inline-block; 
  width: 100%;
  height: 35px;
  border-radius: 5px;
  margin-bottom: 50px;
  font-family: inherit; 
  font-size: 1rem;
 }
  




              
            
!

JS

              
                
              
            
!
999px

Console