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

              
                <main>
  <h1 id="title">Student-Eating Survey Form</h1>
  <p id="description">Thank you for taking the time to help us improve the platform</p>
  <form id="survey-form">
    <div class="form-group">
      <label id="name-label" for="name">Name:</label>
      <input type="text" id="name" name="name" placeholder="Enter your name" class="form-control" required />
    </div>
    <div class="form-group">
      <label id="email-label" for="email">Email:</label>
      <input type="email" id="email" name="email" placeholder="Enter your email" class="form-control" required />
    </div>
    <div class="form-group">
      <label id="number-label" for="number">Age:<span class="hint">(optional)</span></label>
      <input type="number" id="number" name="age" placeholder="Enter your age, from 1 to 99" min="1" max="99" class="form-control" />
    </div>

    <div class="form-group">
      <fieldset>
        <legend>1. When shopping for food which do you consider important?<span class="hint">&#40;Check all that apply&#41;</span></legend>
        <label><input class="input-checkbox" type="checkbox" name="importance" value="savings" />Saving Money</label>
        <label><input class="input-checkbox" type="checkbox" name="importance" value="convenience" />Convenience/ease of purchase (location of shop)</label>
        <label><input class="input-checkbox" type="checkbox" name="importance" value="origin" />Origin of the food</label>
        <label><input class="input-checkbox" type="checkbox" name="importance" value="quality" />The quality of the ingredients</label>
        <label><input class="input-checkbox" type="checkbox" name="importance" value="other" />Other</label>
      </fieldset>
    </div>

    <div class="form-group">
      <fieldset>
        <legend>2. When cooking food which of the following do you think about?<span class="hint">&#40;Check all that apply&#41;</span></legend>
        <label><input class="input-checkbox" type="checkbox" name="think-about" value="how-long" />How long does it take to make</label>
        <label><input class="input-checkbox" type="checkbox" name="think-about" value="tastiness" />How tasty is the food going to be</label>
        <label><input class="input-checkbox" type="checkbox" name="think-about" value="ease" />How easy it is going to be to make</label>
        <label><input class="input-checkbox" type="checkbox" name="think-about" value="healthiness" />How healthy the meal is going to be</label>
        <label><input class="input-checkbox" type="checkbox" name="think-about" value="other" />Other</label>
      </fieldset>
    </div>

    <div class="form-group">
      <fieldset>
        <legend>3. How much would you typically spend on food per week?</legend>
        <label><input class="input-radio" type="radio" name="budget" value="to20" checked />0 - 20</label>
        <label><input class="input-radio" type="radio" name="budget" value="to30" />20 - 30</label>
        <label><input class="input-radio" type="radio" name="budget" value="to40" />30 - 40</label>
        <label><input class="input-radio" type="radio" name="budget" value="over40" />40+</label>
      </fieldset>
    </div>

    <div class="form-group">
      <fieldset>
        <legend>4. Do you ever shop for food online?</legend>
        <label><input class="input-radio" type="radio" name="shop-online" value="often" />Yes often</label>
        <label><input class="input-radio" type="radio" name="shop-online" value="yes" />Yes</label>
        <label><input class="input-radio" type="radio" name="shop-online" value="no" />No</label>
      </fieldset>
    </div>

    <div class="form-group">
      <fieldset>
        <legend>5. Are you aware of the home food delivery concept Hellofresh or gousto?</legend>
        <label><input class="input-radio" type="radio" name="aware" value="yes" />Yes</label>
        <label><input class="input-radio" type="radio" name="aware" value="no" />No</label>
      </fieldset>
    </div>

    <div class="form-group">
      <label for="dropdown">5a. (If yes) Have you tried it? Or would you try it if it was more targeted towards students?</label>
      <select id="dropdown" name="tried-it" class="form-control" required>
        <option disabled selected value="">Choose your answer</option>
        <option value="yes-if-relevant">Yes, I would try it if it was more relevant to my lifestlye</option>
        <option value="yes">Yes I've tried it</option>
        <option value="not-yet">I haven't tried it yet</option>
        <option value="no">I have no interest in trying it</option>
      </select>
    </div>

    <div class="form-group">
      <fieldset>
        <legend>5b. (If no) What if there was either an app or a website that had fast, healthy, and easy-to-cook recipes tasting just as good as restaurant food, along with a scheduled service that delivered fresh ingredients to all your favorite meals to your door ready to cook, would you use such a service?</legend>
        <label><input class="input-radio" type="radio" name="spending" value="definitely" checked />Yes, definitely</label>
        <label><input class="input-radio" type="radio" name="spending" value="will-try" />I'd give it a try</label>
        <label><input class="input-radio" type="radio" name="spending" value="prob-not" />Probably not</label>
        <label><input class="input-radio" type="radio" name="spending" value="no" />No</label>
      </fieldset>
    </div>

    <div class="form-group">
      <label for="comments">For further comments or suggestions let us know below</label>
      <textarea class="form-control" name="comments" id="comments" placeholder="Enter your comment here..."></textarea>
    </div>

    <div class="form-group">
      <button type="submit" id="submit" class="submit-button">Submit</button>
    </div>
    <span class="data-source">[1] 7 quick simple questions about food;
      <a href="https://www.surveymonkey.co.uk/r/student-eating" target="_blank">https://www.surveymonkey.co.uk/r/student-eating</a>
    </span>
  </form>
</main>

<footer>
  A project in the
  <a href="https://www.freecodecamp.org/learn/responsive-web-design/#css-grid" target="_blank">
    <img class="fcc" src="https://aws1.discourse-cdn.com/freecodecamp/original/3X/4/c/4c06248fcb7353707abcde9f10fc43a5fb6748db.svg" alt="freeCodeCamp" width="152" height="17" /></a>
  Responsive Web Design Course
</footer>

<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
              
            
!

CSS

              
                *,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  font-size: 10px;
  padding: 0;
}

body {
  font-family: Poppins, Arial, sans-serif;
  font-size: 1.6rem;
  line-height: 1.6;
  text-align: center;
  color: white;
  background-image: linear-gradient(
      rgba(230, 160, 81, 0.6),
      rgba(189, 53, 20, 0.6)
    ),
    url(https://images.unsplash.com/photo-1517610317588-57acba78aef2?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=735&q=80);
  background-size: cover;
}

#title {
  margin-top: 5rem;
}

h1 {
  font-size: 4.2rem;
  font-weight: 600;
  text-align: center;
  line-height: normal;
}

#description {
  font-size: 2rem;
  font-style: italic;
  font-weight: 200;
  text-align: center;
  margin-bottom: 2rem;
}

#survey-form {
  font-size: 1.8rem;
  max-width: 730px;
  margin: 0 auto 50px auto;
  padding: 40px 40px 10px;
  background-color: rgb(27, 27, 50, 0.6);
  text-align: left;
  line-height: 1.2;
}

.form-group {
  margin: 0 auto 1.25rem auto;
  padding: 0.25rem;
}

.form-control {
  display: block;
  width: 100%;
}

input,
select,
textarea {
  padding: 10px 15px;
  font: inherit;
  font-size: 1.6rem;
  border: none;
  border-radius: 0.5rem;
}

select:invalid {
  color: rgb(109, 109, 109);
}

option {
  color: black;
}

label {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

fieldset,
legend {
  border: 0;
  padding: 0;
  margin-bottom: 0.5rem;
}

.input-radio,
.input-checkbox {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-block;
  margin-right: 10px;
}

.hint {
  font-size: 1.5rem;
  margin-left: 0.7rem;
}

#comments {
  border: 1px solid grey;
}

.submit-button {
  padding: 1rem;
  width: 100%;
  font-size: 1.5rem;
  background-color: green;
  color: white;
  border: none;
  border-radius: 0.5rem;
}

.submit-button:hover,
.submit-button:focus {
  background-color: white;
  color: black;
  box-shadow: 0 0 8px white;
  cursor: pointer;
}

.data-source,
a {
  display: inline-block;
  font-size: 1.2rem;
  color: white;
  margin-top: 1rem;
}

footer {
  font-size: 1.5rem;
  background: #403f3e;
  color: white;
  padding: 8px;
  text-align: center;
}

.fcc {
  margin-bottom: -0.4rem;
}

@media screen and (max-width: 610px) {
  h1 {
    line-height: 1;
    margin-bottom: 1rem;
  }

  .input-radio,
  .input-checkbox {
    flex: none;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console