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

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

<div class="container">
  <h1 id="title">My Survey Form</h1>
  <p id="description">Please fill out this survey so we can improve our service</p>
  <form id="survey-form">
    <div class="labels">
      <label for="name" id="name-label">Name:</label>
    </div>
    <input id="name" type="text" placeholder="Enter your name" class="rightInputs" required><br>
    <div class="labels">
      <label for="email" id="email-label">Email:</label><br>
    </div>
    <input id="email" type="email" placeholder="Enter your email" class="rightInputs" required><br>
    <div class="labels">
      <label for="number" id="number-label">Number:</label><br>
    </div>
    <input id="number" type="number" min="0" max="10000000" placeholder="Enter your number" class="rightInputs"><br>
    <div class="labels">
      <label for="Age" id="age-label">Age range:</label>
    </div>
    <select id="dropdown" name="age" class="rightInputs">
      <option value="less than 18">less than 18</option>
      <option value="18-21">18-21</option>
      <option value="21-30">21-30</option>
      <option value="31-40">31-40</option>
      <option value="41-50">41-50</option>
      <option value="Older than 50">50+</option>
    </select>

    <div class="labels">
      <label for="gender" id="gender_type">Gender:</label>
    </div>
    <input id="gender" type="radio" value="Male" class="input-radio" name="gender" >Male
        <input id="gender" type="radio" value="Female" class="input-radio" name="gender">Female
            <input id="gender" type="radio" value="Else" class="input-radio" name="gender">Else <br>
    <div class="labels">
      <label id="music_type">Favorite Music:</label>
    </div>
      <label name="fav_music" for="music"><input id="Rock" type="checkbox" value="Rock" class="input-checkbox">Rock</label>
          <label name="fav_music" for="music"><input id="Pop" type="checkbox" value="Pop" class="input-checkbox">Pop</label>
          <label name="fav_music" for="music"><input id="Jazz" type="checkbox" value="Jazz" class="input-checkbox">Jazz</label><br>
    
        <div class="labels">
      <label id="comments">Additional Comments:</label>
    </div>
        <textarea
        id="comments"
        class="rightInputs"
        name="comment"
        placeholder="Enter your comment here..."
      ></textarea><br>
  <div id="submitbutton">
          <button type="submit" id="submit" class="submit-button">
        Submit
      </button>
    </div>
    
  </form>
</div>
              
            
!

CSS

              
                :root {
  --color-white: #f3f3f3;
  --color-darkblue: #1b1b32;
  --color-darkblue-alpha: rgba(27, 27, 50, 0.8);
  --color-green: #37af65;
}

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

body {
    background: rgba(0, 128, 0, 0.3); /* Green background with 30% opacity */

    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.4;
    color: var(--color-white);
    margin: 4;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: -1;
    background: var(--color-darkblue);
    background-image: linear-gradient( 
115deg
, rgba(58, 58, 158, 0.8), rgba(136, 136, 206, 0.7) ), url(https://www.freeimages.com/photo/technology-background-1632715);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}



#title {
  text-align: center;
  padding: 20px;
}

#description{
    text-align: center;

}

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

form {
  background: var(--color-darkblue-alpha);
  padding: 2.5rem .625rem;
  border-radius: 0.25rem;
    margin: 0 auto;
    width: 80%;
}

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

.labels {
  display: inline-block;
  text-align: right;
  width: 40%;
  padding: 5px;
  vertical-align: middle;
  margin-top: 10px;
}

.rightInputs {
  display: inline-block;
  text-align: left;
  width: 24%;
  vertical-align: middle;
}

.input-radio
{
  display: inline-block;
  margin-right: 0.625rem;
  min-height: 1.15rem;
  min-width: 1.15rem;
  vertical-align: middle;
}

.submit-button {
  display: block;
    background: var(--color-green);
  width: 10%;
  padding: 0.75rem;
  color: inherit;
  border-radius: 22px;
  cursor: pointer;
  vertical-align: middle;
  text-align: center;
margin: 0 auto;
  margin-top: 40px;
}
              
            
!

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