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">
  Physical Activity during the COVID-19 Pandemic
</h1>

<p id="description">
  <em>Thank you for taking your time to help with this survey</em>
</p>

<div class="container">
  <form id="survey-form">
  <label for="name" id="name-label" class="label">Name</label>
    
  <input id="name" 
         type="text" required
         placeholder="Enter your name"
         name="name">
  
  
  <label for="email" id="email-label" class="label">Email</label>
  
  <input id="email"
         type="email" required
         placeholder="Enter your email"
         name="email">
 
  
  <label for="number" id="number-label" class="label">Age</label>
  
  <input id="number"
         type="number" required
         min="14"
         max="100"
         placeholder="How old are you?"
         name="number">
  
  
  <label for="dropdown" id="dropdown-label" class="label">How do you spend most of your day?
 
    
  <select id="dropdown" name="dropdown" required>
    <option value="" disabled selected>Please choose one</option>
    <option value="Standing">Standing</option>
    <option value="Seated">Seated</option>
    <option value="Walking">Walking</option>
    <option value="Lying down">Lying down</option>
    </select>
      
    </label>
    
    
        <label for="number-2" id="number-label-2" class="label">In the past week, on how many days did you practice any physical activity for at least 20 minutes?</label>
  
  <input id="number-2"
         type="number" required
         min="0"
         max="7"
         placeholder="Number of days"
         name="number-2">
  
  
  <label for="dropdown-2" id="dropdown-label-2" class="label">If you practiced physical activity in the past week, what was the duration? (optional)
 
    
  <select id="dropdown-2" name="dropdown-2">
    <option value="" disabled selected>Please choose one</option>
    <option value="Less than 30 minutes">Less than 30 minutes</option>
    <option value="Between 30 and 60 minutes">Between 30 and 60 minutes</option>
    <option value="More than 60 minutes">More than 60 minutes</option>
          </select>
            
          </label>
         
     <p class="label-radio-checkbox">Comparing a typical week before COVID-19 with a typical week now, do you think you are doing less, more or about the same amount of physical activity or exercise during the Pandemic?</p> 
    <label for="Less" class="checkbox-radio-option">
    
      <input type="radio" required
           id="Less"
           name="frequency"
           value="Less"> Less</label>
   
    
    <label for="About-the-same" class="checkbox-radio-option">
    
    <input type="radio" required
           id="About-the-same"
           name="frequency"
           value="About the same"> About the same</label>
    
  
    <label for="More" class="checkbox-radio-option">
    
    <input type="radio" required
           id="More"
           name="frequency"
           value="More"> More</label>
    
   
    <p class="label-radio-checkbox">Which, if any, of the following physical activities have you done in the past week for at least 20 minutes? (Check all that apply)</p>
     
    <label for="Walking" class="checkbox-radio-option">
     <input id="Walking"
           type="checkbox"
           value="Walking"
        name="checkbox">Walking</label>
    
    <label for="Cycling" class="checkbox-radio-option">
      <input id="Cycling"
           type="checkbox"
           value="Cycling"
             name="checkbox">Cycling</label>
    
     <label for="Running-or-Jogging" class="checkbox-radio-option">
    <input id="Running-or-Jogging"
           type="checkbox"
           value="Running or Jogging"
           name="checkbox">Running or Jogging</label>
  
     <label for="Swimming" class="checkbox-radio-option">
    <input id="Swimming"
           type="checkbox"
           value="Swimming"
           name="checkbox">Swimming</label>
  
     <label for="Tennis" class="checkbox-radio-option">
    <input id="Tennis"
           type="checkbox"
           value="Tennis"
           name="checkbox">Tennis</label>
    
    <label for="Workout-at-the-gym" class="checkbox-radio-option">
  
    <input id="Workout-at-the-gym"
           type="checkbox"
           value="Workout at the gym"
           name="checkbox">Workout at the gym</label>
    
    <label for="Workout-at-home" class="checkbox-radio-option">
  
    <input id="Workout-at-home"
           type="checkbox"
           value="Workout at home"
           name="checkbox">Workout at home</label>
    
    <label for="Housework" class="checkbox-radio-option">
  
    <input id="Housework"
           type="checkbox"
           value="Housework (cleaning, gardening, etc.)"
           name="checkbox">Housework (cleaning, gardening, etc.)</label>
    
    <label for="Informal-games" class="checkbox-radio-option">
  
    <input id="Informal-games"
           type="checkbox"
           value="Informal games or activities (catching, throwing, jumping, etc.)"
           name="checkbox">Informal games or activities (catching, throwing, jumping, etc.)</label>
    
    <label for="Yoga-or-Stretching" class="checkbox-radio-option">
  
    <input id="Yoga-or-Stretching"
           type="checkbox"
           value="Yoga or Stretching"
           name="checkbox">Yoga or Stretching</label>
    
    <label for="Dancing" class="checkbox-radio-option">
  
    <input id="Dancing"
           type="checkbox"
           value="Dancing"
           name="checkbox">Dancing</label>
    
    <label for="I-have-not-done-any-physical-activity-in-the-past-week" class="checkbox-radio-option">
  
    <input id="I-have-not-done-any-physical-activity-in-the-past-week"
           type="checkbox"
           value="I have not done any physical activity in the past week"
           name="checkbox">I have not done any physical activity in the past week</label>
    
    <label for="Other">
    <input id="Other"
           type="checkbox"
           value="Other"
           name="checkbox">Other</label>
    
     <label for="textarea" id="textarea-label" class="label">Any additional comments?</label>

    <textarea id="textarea" 
          name="textarea"
          cols="60"
          rows="5"
          placeholder="Enter your comment here...">
</textarea>

    <button type="submit"
        id="submit" class="button">Submit
    </button>
  </form>
    </div>
              
            
!

CSS

              
                @media only screen and (max-width: 767px) {
 * {
  box-sizing: border-box;
  max-width: 100%;
  height: auto;
}

input[type=text], input[type=email], input[type=number], input[type=dropdown], select, textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
}

body {
    background-color: #ffffe6;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
}

#title, #description {
  text-align: center;
}

.container{
  display: inline-block;
  text-align: left;
}

#survey-form {
  background-color: rgb(64, 64, 64, 0.9);
  color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin: 10px 5px 10px 5px;
  padding: 15px 35px 60px 35px;
  max-width: 100%;
  height: auto;
}

[type='radio'], [type='checkbox'] {
  display: inline-block;
}

.label {
  display: inline-block;
  margin-top: 20px;
  width: 100%;
}

.label-radio-checkbox {
  margin: 20px 0px 0px 0px;
}

 .checkbox-radio-option {
    display: block;
    text-align: left;
    height: auto;
   line-height: 1.9;
    font-size: 16px;
   padding-bottom: 5px;
  }
  
.button {
  width: 100%;
  padding: 12px 0px 12px 0px;
  margin-top: 15px;
  background-color: #4eb167;
  color: rgb(255, 255, 255);
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  font-size: 16px;
}

}

@media only screen and (min-width: 768px) {

  * {
  box-sizing: border-box;
}

input[type=text], input[type=email], input[type=number], input[type=dropdown], select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

body {
    background-image: url("https://media.timeout.com/images/105755421/image.jpg");
    background-size: cover;
    background-color: #ffffe6;
    font-family: 'Lato', sans-serif;
    font-size: 16px;
}

#title, #description {
  text-align: center;
}

.container {
  display: block;
  text-align: left;
  line-height: 1.9;
  padding: 5px 200px 0px 200px;  
}

#survey-form {
  background-color: rgb(64, 64, 64, 0.9);
  color: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin: 10px 5px 10px 5px;
  padding: 15px 35px 60px 35px;
}

input[type='radio'], input[type='checkbox'] {
  display: inline-block;
}

.label {
  display: inline-block;
  margin-top: 20px;
  width: 100%;
}

.label-radio-checkbox {
  margin: 20px 0px 0px 0px;
}

  .checkbox-radio-option {
    display: block;
    text-align: left;
    height: auto;
    line-height: 1.6;
    font-size: 16px;
    padding-bottom: 12px;
  }  
  
.button {
  width: 100%;
  padding: 12px 0px 12px 0px;
  margin-top: 15px;
  background-color: #4eb167;
  color: rgb(255, 255, 255);
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  font-size: 16px;
}

.button:hover {
  background-color: #46a049;
  color: rgb(255, 255, 255);
}
}
              
            
!

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