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>

<!DOCTYPE html>
<html>

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

<body>
  <main>
    <header>
      <h1 id="title">Nice Cream Survey</h1><br>
      <p id="description"><em><strong>Your responses will help us make Nice Cream even nicer!</strong></em></p><br>
    </header>
    <form id="survey-form">
      <label id="name-label" for="name">Name<br><input type="text" id="name" placeholder="What's your name?" required></label><br>
      <label id="email-label" for="email">Email<br><input type="email" id="email" placeholder="We won't spam you, we promise." required></label><br>
      <label id="number-label" for="number">Age (optional)<br><input type="number" id="number" placeholder="It's our little secret." min="0" max="120" style="width: 150px;"></label><br>
      <label for="dropdown">How long have you been enjoying Nice Cream?<br><select name="familiarity" id="dropdown" required>
          <option disabled hidden selected>Oh, do tell!</option>
          <option value="never-tried">I've never tried it</option>
          <option value="tried-once">I've had the pleasure once</option>
          <option value="tried-a-few-times">I've had it a few times</option>
          <option value="tried-many-times">I can't remember life before it</option>
        </select></label><br>
      <label for="vanilla">Which flavor is your favorite?<br><span class="flavor-text"><input id="vanilla" type="radio" name="favorite-flavor" value="vanilla">Vanilla</span></label><br>
      <label for="chocolate"><span class="flavor-text"><input id="chocolate" type="radio" name="favorite-flavor" value="chocolate">Chocolate</span></label><br>
      <label for="cherry chip"><span class="flavor-text"><input id="cherry chip" type="radio" name="favorite-flavor" value="cherry chip">Cherry Chip</span></label><br>
      <label for="pb-banana"><span class="flavor-text"><input id="pb-banana" type="radio" name="favorite-flavor" value="pb-banana">PB & Banana</span></label><br>
      <label for="cotton-candy">Which flavors sound good to you?<br><span class="flavor-text"><input id="cotton-candy" type="checkbox" name="flavor-suggestions" value="cotton-candy">Cotton Candy</span></label><br>
      <label for="butterscotch"><span class="flavor-text"><input id="butterscotch" type="checkbox" name="flavor-suggestions" value="butterscotch">Butterscotch</span></label><br>
      <label for="peach"><span class="flavor-text"><input id="peach" type="checkbox" name="flavor-suggestions" value="peach">Peach</span></label><br>
      <label for="salted-caramel"><span class="flavor-text"><input id="salted-caramel" type="checkbox" name="flavor-suggestions" value="salted-caramel">Salted Caramel</span></label><br>
      <label for="comments">Anything else you want to share?<br><textarea id="comments" name="additional-comments" placeholder="Dear Nice Cream,
I never knew what a gift to the world bananas were until I met you..." rows="8" cols="73"></textarea></label><br>
      <button id="submit" type="submit">Away we go!</button>
    </form>
  </main>
</body>

</html>
              
            
!

CSS

              
                :root {
  --pacific-font: "Pacifico", cursive;
  --pink: pink;
  --pacifica-color: #821155;
  --input-width: 600px;
  --big-dots: 5px dotted;
}

body {
  background: url(https://media.istockphoto.com/vectors/fruit-banana-pattern-vector-id1131390023?k=6&m=1131390023&s=612x612&w=0&h=hgTJtqeSoo_jgJihu0NE5r0zaoZkbydWIKM_xz2DFPo=);
}

#title {
  position: relative;
  z-index: 1;
  color: var(--pacifica-color);
  background: var(--pink);
  opacity: 0.96;
  text-align: center;
  font-family: var(--pacific-font);
  border: var(--big-dots);
  border-color: black;
  border-radius: 20px;
  font-size: 50px;
  width: 700px;
  margin: 80px auto -35px auto;
  padding-bottom: 40px;
}

#description {
  position: relative;
  z-index: 3;
  text-align: center;
  font-size: 20px;
  font-family: sans-serif;
  width: 375px;
  margin: -45px 0px 0px 478px;
}

#survey-form {
  width: 600px;
  margin: 20px auto 50px auto;
  text-align: left;
  line-height: 37px;
  background: var(--pink);
  opacity: 0.96;
  border-radius: 5%;
  border: var(--big-dots);
  border-color: black;
  font-size: 25px;
  font-family: var(--pacific-font);
  color: var(--pacifica-color);
  padding: 40px 57px 40px 45px;
}

#name {
  width: var(--input-width);
  height: 36px;
  margin-bottom: 20px;
  border-radius: 5px;
  border: none;
  font-family: ;
}

#email {
  width: var(--input-width);
  height: 36px;
  margin-bottom: 20px;
  border-radius: 5px;
  border: none;
}

#number {
  height: 36px !important;
  width: var(--input-width) !important;
  margin-bottom: 20px;
  border-radius: 5px;
  border: none;
}

#dropdown {
  width: 607px;
  height: 39px;
  margin-bottom: 30px;
  border-radius: 5px;
  border: none;
}

.flavor-text {
  font-family: sans-serif;
  color: black;
}

#pb-banana {
  margin-bottom: 30px;
}

#salted-caramel {
  margin-bottom: 30px;
}

#comments {
  margin-top: 6px;
  margin-bottom: 15px;
  border-radius: 5px;
  border: none;
  font-size: 16px;
  font-family: sans-serif;
}

#submit {
  font-size: 18px;
  width: 607px;
  height: 37px;
  border-radius: 5px;
  border: none;
  color: white;
  background: var(--pacifica-color);
}

button:hover {
  transform: scale(1.02);
}

              
            
!

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