Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

              
                <head><title>Survey Form</title></head>

<body>
  <h1 id="title">Fruits vs Meat Survey Form</h1>
  <h3>Thank you for taking out the time to go through this survey</h3>


<p id="description">We are currently running a survey to know the benefits of fruit based versus meat based diets <br> and how they help with our body's immunity against infections and diseases.</p>



<form id="survey-form">
<div>
  <label for="name" id="name-label">Name</label><br>
    <input type="text" id="name" placeholder="Type in Name" required>
  </div>
  
 
  <div>
  <label for="email" id="email-label">Email</label><br>
  <input type="email" id="email" placeholder="Type in Email" required>
  </div>
  
  
  <div>
  <label for="number" id="number-label">Age (optional)</label><br>
<input type="number" id="number" name="number" min="10" max="99" placeholder="Type in Age" required>
      </div>
  
 
  <div>
    <label for="dropdown">Select an Option</label><br>
    <select id="dropdown" name="dropdown" deselected>
      <option value="fruits">Eat fruits more</option>
      <option value="meats">Eat meats more</option>
      <option value="both">A mixture of both</option>
    </select>
  </div>
  <br>
   
    
    <div>
      <p>Pick a fruit out of the following</p>
  <span><input type="radio" id="watermelon" class="fruit-list" name="fruit-list" value="watermelon">
    <label for="watermelon">Watermelon</label></span>
     <span><input type="radio" id="apple" class="fruit-list" name="fruit-list" value="apple">
       <label for="apple" >Apple</label></span>
    <span><input type="radio" id="banana" class="fruit-list" name="fruit-list" value="banana">
      <label for="banana">Banana</label></span>
      </div>
    
    <div> 
    <p>What are your sources of meat?</p>
  <span><input type="checkbox" id="domesticated" class="meat-list" name="meat-source" value="domesticated">
    <label for="domesticated">Domesticated</label></span>
   <span><input type="checkbox" id="wild" class="meat-list" name="meat-source" value="wild">
     <label for="wild">Wild</label></span>
   <span><input type="checkbox" id="processed" class="meat-list" name="meat-source" value="processed">
     <label for="processed">Processed</label></span>
      </div>
    
    <div>
      <label for="textarea" class="text">Tell us about your current diet</label><br>
      <textarea name="textarea" id="textarea" cols="30" rows="10" placeholder="Your Comments here"></textarea>
    </div>
    
   <button type="submit" id="submit">Submit</button>
</form>
  
  </body>
              
            
!

CSS

              
                #title {
  text-align: center;
  
}

h3 {
  text-align: center;
}

#description {
  text-align: center;
  
}

body{
     background-image: url("https://i.postimg.cc/YCnxMwng/Project-Background-Image.jpg");
  background-color: rgb(168, 233, 76, 0.3);
background-size: cover;
  
}

#survey-form {
  background-color: rgb(47, 236, 0);
  border: solid;
  border-radius: 5px;
  margin-left: 25%;
  margin-right: 25%;
  text-align: left;
  padding-left: 100px;
  padding-top: 20px;
  padding-bottom: 20px;
  
}

input{
  border-radius: 10px;
  
}

#name {
  width: 400px;
  padding-top: 5px;
  padding-left: 10px;
  padding-bottom: 5px;
  margin-bottom: 20px;
}

#email {
   width: 400px;
  padding-top: 5px;
  padding-left: 10px;
  padding-bottom: 5px;
  margin-bottom: 20px;
}

#number {
   width: 400px;
  padding-top: 5px;
  padding-left: 10px;
  padding-bottom: 5px;
  margin-bottom: 20px;
}

#dropdown {
  width: 420px;
  margin-bottom: 10px;
  border-radius: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
}


}
.fruit-list {
 margin-bottom: 10px;
}

.meat-list {
  margin-bottom: 10px;
}

.text{
 margin-top: 20px;
}


#textarea {
  width: 400px;
  border-radius: 5px;
 margin-top: 5px;
  margin-bottom: 15px;
}

#submit {
  width: 410px;
  height: 40px;
  
}

span {
  display: block;
  margin-bottom: 10px;
}
              
            
!

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