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

Auto Save

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

              
                <!--Start form container-->
<div class="container">

  <!--Start header-->
  <header>
    <div class="text-center">
      <h1 id="title">Crochet-A-Toy</h1>
      <p id="description">Thank you for helping us improve our classes!</p>
    </div>
  </header>
  <!--End header-->

  <!--Form start-->
  <form id="survey-form" action="#">

    <!--Name form group start-->
    <div class="form-group">
      <label id="name-label" for="name">Name: </label>
      <input type="text" name="name" id="name" class="form-control" placeholder="Jennifer Davis" required>
    </div>
    <!--Name form group end-->

    <!--Email form group start-->
    <div class="form-group">
      <label id="email-label" for="email">Email:</label>
      <input type="email" name="email" id="email" class="form-control" placeholder="example@gmail.com" required>
    </div>
    <!--Email form group end-->

    <!--Class number form group start-->
    <div class="form-group">
      <label id="number-label" for="number">How many classes have you taken?
      </label>
      <input type="number" name="classes" id="number" min="1" max="10" class="form-control" placeholder="1" required>
    </div>
    <!--Class number form group end-->

    <!--Skill form group start-->
    <div class="form-group">
      <label id="skill-label" for="skill">What's your skill level?</label>
      <select id="dropdown" name="role" class="form-control" required>
        <option>Beginner</option>
        <option>Intermediate</option>
        <option>Advanced</option>
      </select>
    </div>
    <!--Skill form group end-->

    <!--Class checkbox form group start-->
    <div class="form-group">
      <p>Which classes did you take?</p>
      <label for="learn" class="label-checkbox"><input type="checkbox" value="learn" name="learn" class="input-checkbox" checked>
        Learn to Crochet</label>
      <label for="amigurumi" class="label-checkbox"><input type="checkbox" value="amigurumi" name="amigurumi" class="input-checkbox">
        Intro to Amigurumi</label>
      <label for="bear" class="label-checkbox"><input type="checkbox" value="bear" name="bear" class="input-checkbox">
        Crochet-a-Bear</label>
      <label for="doll" class="label-checkbox"><input type="checkbox" value="doll" name="doll" class="input-checkbox">
        Crochet-a-Doll</label>
      <label for="garden" class="label-checkbox"><input type="checkbox" value="garden" name="garden" class="input-checkbox">
        Crochet-a-Garden</label>
      <label for="zoo" class="label-checkbox"><input type="checkbox" value="zoo" name="zoo" class="input-checkbox">
        Crochet-a-Zoo</label>
    </div>
    <!--Class checkbox form group end-->

    <!--Recommend form group start-->
    <div class="form-group">
      <p>Would you recommend our classes?</p>
      <label for="absolutely" class="label-radio"><input type="radio" id="absolutely" name="recommend" value="absolutely" class="input-radio" checked>
        Absolutely</label>
      <label for="maybe" class="label-radio"><input type="radio" id="maybe" name="recommend" value="maybe" class="input-radio">
        Maybe</label>
      <label for="not-sure" class="label-radio"><input type="radio" id="not-sure" name="recommend" value="not-sure" class="input-radio">
        Not sure</label>
    </div>
    <!--Recommend form group end-->

    <!--Comments form group start-->
    <div class="form-group">
      <label for="comments">Any comments or suggestions?</label>
      <textarea id="comments" name="comment" placeholder="Don't be shy :)"></textarea>
    </div>
    <!--Comments form group end-->

    <!--Submit button start-->
    <button type="submit" id="submit" class="submit-button">Submit Your Review</button>
    <!--Submit button end-->

  </form>
  <!--Form end-->

</div>
<!--End form container-->

<!--Footer start-->
<footer>
  <p>Coded with 🍵 by Anna Maria Yates</p>
  <div id="social-media-icons">
    <div>
      <a href="https://www.freecodecamp.org/annamariayates" target="_blank"><i class="fab fa-free-code-camp"></i></a>
    </div>
    <!--freeCodeCamp-->
    <div>
      <a href="https://www.github.com/annamariayates" target="_blank">
        <i class="fab fa-github"></i></a>
    </div>
    <!--GitHub-->
    <div>
      <a href="https://www.linkedin.com/in/annamariayates" target="_blank"><i class="fab fa-linkedin"></i></a>
    </div>
    <!--LinkedIn-->
  </div>
  <!--social media icons-->
</footer>
<!--Footer end-->
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css?family=Delius+Swash+Caps&display=swap");

@import url("https://fonts.googleapis.com/css?family=Varela+Round&display=swap");

:root {
  --color-gray: #333;
  --color-baby-blue: #56baec;
  --color-baby-blue-alpha: rgba(86, 186, 236, 0.85);
  --color-white: #fff;
  --color-yellow: #ffe44b;
  --color-yellow-hover: #fed700;
  --color-fcc-hover: #0a0a23;
  --color-github-hover: #707070;
  --color-linkedin-hover: #0e76a8;
}

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

html {
  font-size: 100%;
}

body {
  font-size: 1rem;
  font-family: "Varela Round", sans-serif;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-gray);
}

/* Mobile-friendly fixed background image 
(Source: https://codepen.io/freeCodeCamp/pen/VPaoNP) */

body::before {
  content: " ";
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: -1;
  background-image: url(https://images.unsplash.com/photo-1619234711431-644a9d28d6ab?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1649&q=80);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 20%;
}

h1 {
  font-size: 2.488rem;
  font-family: "Delius Swash Caps", cursive;
  margin-bottom: 1rem;
}

p {
  font-size: 1.125rem;
}

.container {
  width: 100%;
  margin: 3.125rem auto;
}

header {
  margin-bottom: 3.75rem;
}

#title {
  color: var(--color-baby-blue);
}

.text-center {
  text-align: center;
}

#survey-form {
  background-color: var(--color-baby-blue-alpha);
  border: 4px dashed var(--color-white);
  border-radius: 10px;
  box-shadow: 0 0 0 25px var(--color-baby-blue-alpha);
  padding: 3.25rem;
  margin: 0 1.65rem;
}

.form-group {
  margin-bottom: 2rem;
}

.form-group > p {
  font-size: 1.25rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
}

label {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  font-weight: bold;
}

input,
button,
select,
textarea {
  margin: 0;
  border: none;
  font-family: inherit;
  font-size: 1.125rem;
  line-height: inherit;
}

.form-control {
  color: var(--color-grey);
  display: block;
  width: 100%;
  height: 2.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
}

input:focus,
.form-control:focus,
textarea:focus,
button:focus {
  outline: 0;
  box-shadow: 0 0 0 3.2px rgba(79, 102, 55, 0.25);
}

/*--- Custom checkboxes and radio buttons using MDN's Web Docs: https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Advanced_styling_for_HTML_forms ---*/

/* Hide browser's default checkbox and radio button styling */

input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

input[type="checkbox"] {
  position: relative;
  width: 1.125rem;
  height: 1.125rem;
  background-color: var(--color-white);
  border: none;
  border-radius: 4px;
  /* Adjusts the position of the checkboxes on the text baseline */
  vertical-align: -2px;
  /* Set here so that Windows' High-Contrast Mode can override */
  color: var(--color-gray);
}

input[type="radio"] {
  position: relative;
  width: 1.125rem;
  height: 1.125rem;
  background-color: var(--color-white);
  border: none;
  border-radius: 50%;
  /* Adjusts the position of the checkboxes on the text baseline */
  vertical-align: -2px;
  /* Set here so that Windows' High-Contrast Mode can override */
}

input[type="checkbox"]::before {
  content: "✔";
  position: absolute;
  font-size: 1.125rem;
  right: 0;
  top: -0.3em;
  visibility: hidden;
}

input[type="radio"]::before {
  content: "🔘";
  position: absolute;
  right: -0.2em;
  top: -0.215em;
  visibility: hidden;
}

input[type="checkbox"]:checked::before {
  /* Use `visibility` instead of `display` to avoid recalculating layout */
  visibility: visible;
}

input[type="radio"]:checked::before {
  /* Use `visibility` instead of `display` to avoid recalculating layout */
  visibility: visible;
}

.label-checkbox,
.label-radio {
  font-size: 1.125rem;
  font-weight: normal;
}

.input-checkbox,
.input-radio {
  display: inline-block;
  margin-right: 0.625rem;
  min-height: 1.125rem;
  min-width: 1.125rem;
}

#comments {
  border-radius: 4px;
  width: 100%;
  min-height: 15vh;
  padding: 0.625rem;
  resize: vertical;
}

.submit-button {
  font-weight: bold;
  letter-spacing: 0.1rem;
  display: block;
  width: 100%;
  background-color: var(--color-yellow);
  border-radius: 4px;
  padding: 1rem;
  cursor: pointer;
}

.submit-button:hover {
  background-color: var(--color-yellow-hover);
}

footer {
  padding: 3.75rem 0 3.125rem;
  text-align: center;
}

footer > p {
  font-weight: normal;
  color: var(--color-gray);
  margin-bottom: 1rem;
}

#social-media-icons {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
}

.fab {
  font-size: 1.6rem;
  padding: 0.625rem 0.625rem 0;
  color: var(--color-gray);
}

.fa-free-code-camp:hover {
  color: var(--color-fcc-hover);
}

.fa-linkedin:hover {
  color: var(--color-linkedin-hover);
}

.fa-github:hover {
  color: var(--color-github-hover);
}

/*--- Media Queries ---*/

@media (max-width: 320px) {
  #survey-form {
    padding: 2.75rem;
  }
  footer > p {
    padding: 0 4.6875rem;
  }
}

@media (min-width: 768px) {
  .container {
    max-width: 625px;
  }
}

              
            
!

JS

              
                // IDs created for freeCodeCamp testing purposes

              
            
!
999px

Console