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

              
                <!-- Coded as a project for the Responsive Web Design course at FreeCodeCamp. Initial structure inspired by the FCC example survey form, coded by @lasjorg. -->

<link href="https://fonts.googleapis.com/css2?family=Galada&display=swap" rel="stylesheet">

<body id="body">
<header>
<h1 id="title">At Home Coffee Brewing Preferences</h1>
  <hr>
  <p id="description"><em><strong>Please tell us a bit about your home-brewing style.</strong></em></p>
  </header>
  
<form id="survey-form">
  <p>
   <label id="name-label" for="name">Name:</label>
  <br>
      <input class="formtext" id="name" type="text" required name="name" placeholder="Enter your name">
  </p>
  <p>
  <label id="email-label" for="email">Email Address:</label>
  <br>
     <input class="formtext" id="email" type="email" required name="email" placeholder="Enter a valid email address">
  </p>
  <p>
  <label id="number-label" for"age">Age (Optional):</label>
  <br>
     <input class="formtext" id="number" min="01" max="110" type="number" name="age" placeholder="Age">
  </p>
  <p>
  <label id="dropdown-label" for="preference1">Choose your preferred brewing method:
    <br>
    (if your method is not listed, please type below)</label>
    <br>
  <select class="drop" id="dropdown" type="dropdown" name="preference1">
  <option value="choose">Choose One</option>    
  <option value="french-press">French press</option>
  <option value="aeropress">Aeropress</option>
  <option value="percolator">Percolator (stove-top or electric)</option>
  <option value="pour-over">Pour over</option>
  <option value="espresso">Home espresso machine</option>
  <option value="brewer">Drip brewer</option>
  <option value="brewer">Single-serve pod style machine</option>
  <option value="other">Other (please explain below)</option>
</select>
  </p>
  <p>
  <label id="other-label" for="other"></label>
      <input class="formtext" id="other-type" type="text" name="other-type" placeholder="Other Method">
  </p>
  <p>
How many cups of coffee do you usually drink, per day?<br>
<label> 
  <input type="radio" value="1-2" name="amount"> 1-2 cups of coffee per day
</label>
  <br>
  <label> 
  <input type="radio" value="2-3" name="amount"> 3-4 cups of coffee per day
</label>
  <br>
   <label> 
  <input type="radio" value="4-plus" name="amount"> 4+ cups of coffee per day
</label>
  </p>
<p>
What is your preferred roast style?
  <br>
  <input type="radio" value="light" name="roast"> Light</label>
  <br>
  <input type="radio" value="medium" name="roast"> Medium</label>
<br>
<input type="radio" value="dark" name="roast"> Dark</label>
<br>
<input type="radio" value="espresso" name="roast"> Espresso</label>
</p>
<p>
  When buying beans, what characteristics do you look for? (check all that apply):
  <br>
  <label>
    <input type="checkbox" value="whole" name="bean-info"> Whole beans</label>
  <br>
    <label>
    <input type="checkbox" value="ground" name="bean-info"> Ground beans</label>
  <br>
  <label>
    <input type="checkbox" value="organic" name="bean-info"> Organic beans</label>
  <br>
  <input type="checkbox" value="trade" name="bean-info"> Fair/direct trade</label>
  <br>
  <input type="checkbox" value="local" name="bean-info"> Locally roasted</label>
<br>
  <input type="checkbox" value="price" name="bean-info"> Best price</label>
</p>
<p>
  Please let us know if you have any other comments:
<textarea name="comments" class="textbox" placeholder="Enter comments here..."></textarea>
</p>
<p>
<button name="submit" 
        id="submit"
        class="button"
        type="submit">
        Submit </button>
</p>
</form>
</body>

              
            
!

CSS

              
                /* Global styling */

#body {
  text-align: left;
  font-size: 1.2rem;
  font-family: calibri, sans-serif;
  height: 100%;
  width: 100%;
  margin: 0;  
  padding-bottom: 25px;
}

/* Background image */

body::after {
  background: url("https://assets.bonappetit.com/photos/5c366551f212512d0e6cefd0/16:9/w_2560%2Cc_limit/Basically-Coffee-0219-03.jpg");
  content: "";
  opacity: 0.455;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: -1;   
}

/* Title and description area */

#title {
  color: brown;
  text-align: center;
  font-size: 2.5rem;
  font-family: galada, cursive;
}

#description {
  text-align: center;
  font-size: 1.2rem;
  font-family: calibri, sans-serif;
}

/* Survey form */

#survey-form {
  display: block;
  background: linear-gradient(180deg,chocolate,burlywood,#c68c53);
  opacity: 0.9;
  width: 40%;
  margin: auto;
  border-radius: 14px;
  padding: 5px 27px 10px 25px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
  line-height: 1.75;
}

.formtext {
  width: 100%;
  height: 30px;
  padding-left: 5px;
  padding-right: 5px;
}

.drop {
  width: 40vw;
  display: block;
  height: 32px;
  padding-left: 2px;
  padding-right: 5px;
}

.textbox {
  min-height: 100px;
  width: 100%;
  resize: vertical;
}

.button {
  display: block;
  width: 100%;
  padding: 12px;
  background: peru;
  cursor: pointer;
  border-radius: 8px;
  transition-duration: 0.5s;
  text-transform: uppercase;
  font-size: 1.2rem;
}

.button:hover {
  background: brown;
  color: whitesmoke;
}
              
            
!

JS

              
                
              
            
!
999px

Console