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>

<body>
  <div>
    <ul id="sidebar">
      <li><a href="#basicinfo">Basic Information</a> </li>
      <li><a href="#vegetables">Healthy Eating</a></li>
      <li><a href="#Submit">Submit</a></li>
    </ul>

  </div>
  <div id="title-section">
    <h1 id="title">Healthy Eating Form</h1>
  </div>
  <div id="main-content">
    <a id="basicinfo"></a>
    <p id="description">This is a survey made to measure the eating habits of people including you. We will email results to you after the survey is complete.</p>
    <form id="survey-form" method="GET">
      <label class="leftarea" id="name-label">
        Your Name
      </label>
      <input type="text" name="Name" id="name" placeholder="enter your name" class="rightarea" required>
      <label class="leftarea" id="email-label" for "email"> Email </label>
      <input type="email" placeholder="enter email" required class="rightarea" id="email">
      <label class="leftarea" id="number-label" for "number"> Age </label>
      <input type="number" placeholder="enter age" required class="rightarea" id="number" min="1" max="125">
      <a name="vegetables"></a>
      <label class="leftarea" id="dropdown-label" for = "dropdown"> How many servings of veggies/fruits do you eat daily?</label>
      <select class="rightarea" id="dropdown" type="dropdown"><option disabled selected value>Select an option</option>
      <option  value="0">0</option>
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
      <option value="5">5</option>
      <option value="More">More</option>
      </select>
      <label class="leftarea" for = "vegetable type"> What vegetables/fruits do you eat?</label>
      <input type="checkbox" name="vegetable type" value="greens" class="check-button" checked>Greens</input>
      <input type="checkbox" name="vegetable type" value="Roots" class="check-button2">Roots</input>
      <input type="checkbox" name="vegetable type" value="fruits" class="check-button3">Fruits</input>
<input type="checkbox" name="vegetable type" value="other" class="check-button3">Other</input>
      <label class="leftarea"> Do you genuinely enjoy vegetables and fruits?</label>
      <input type="radio" name="enjoy" value="yes">Yes</input>
      <input type="radio" name="enjoy" value="no" class="check-button2">No</input>
      <input type="radio" name="enjoy" value="kind of" class="check-button3">Kind Of</input>
      <label class="leftarea" for="textarea"> Additional comments about your eating habits?</label>
<textarea resize = "vertical"></textarea>
<br>
<button id = "submit"type="submit" cursor = "pointer">Submit</button>
    </form>

  </div>
</body>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Lato&display=swap');
#title {
  font-family: Lato, sans-serif;
  text-align: center;
  font-size:35px;
}
body {
  background-image: url(https://www.vegetables.co.nz/assets/Uploads/vegetables.jpg);
  background-attachment: fixed;
}
#title-section {
  background-color:rgb(100, 180, 120);
  width: 60vw;
  min-width: 300px;
  margin: auto;
  margin-top: 5vw;
  margin-bottom: 0px;
  padding: 1vw;
  font-weight: lighter;
}
#main-content {
  background-color: rgb(255, 255, 255);
  padding: 1vw;
  margin-top: 2vw;
  width: 60vw;
  min-width: 300px;
  margin: auto;
  font-family: Lato, sans-serif;
  
}
#sidebar {
  list-style-type: none;
  background-color: #ffffff;
  width: 5vw;
  position: fixed;
  padding-left: 1vw;
  margin-left: 1vw;
  
}
/*Hacking together a rudimentary sidebar*/
#sidebar a {
  display: block;
  color: rgb(0, 0, 0);
  text-decoration: none;
  padding: 1vw;
  padding-left: 2vw;
  margin-left: -2vw;
  padding-right: 4vw;
  width: 5vw;
  background-color: #ffffff;
  font-family: Lato;
}
@media (max-width: 600px){
  #sidebar {
    font-size: 9px;
  }
}
@media (min-width: 600px){
  #sidebar {
    font-size: 11px;
  }
}
@media (min-width: 1000px){
  #sidebar {
    font-size: 12pt;
  }
}
#sidebar a:hover
{
  background-color: rgb(180, 180, 180);
}
.rightarea {
 width: 50%;
  display: inline-block;
  margin-bottom: 1vw;
  margin-right: 0%;
}

.leftarea {
  width: 40%;
  display: inline-block;
  margin-top: 2vw;
  text-align: right;
  padding-right: 2%;
}
@media (max-width: 600px){
  #main-content {
    font-size: 10px;
  }
}
@media (min-width: 600px){
  #main-content {
    font-size: 12px;
  }
}
@media (min-width: 1000px){
  #main-content {
    font-size: 12pt;
  }
}
@media (max-width: 600px){
  #title-section h1 {
    font-size: 25px;
  }
}
@media (min-width: 600px){
  #title-section h1 {
    font-size: 30px;
  }
}
@media (min-width: 1000px){
  #title-section h1 {
    font-size: 40px;
  }
}
.check-button2 {
  margin-left: 5px;
  padding: 10%;
}
.check-button3 {
  margin-left: 5px;
  padding: 10%;
}
#submit {
  background-color: rgb(100, 180, 120);
  border: none;
  color: black;
  padding: 2% 4%;
  font-family: Lato;
  margin-left: 40%;
  margin-top: 5%;
}
textarea {
  resize: vertical;
  padding: 2%;
  margin-top: 2em;
}
input {
  padding: 1%;
}

              
            
!

JS

              
                
              
            
!
999px

Console