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

              
                
    <main>
        <h1 id="title">Survey Form</h1>
        <p id="description">
            Thank you for taking your time to help us fill in the form below
        </p>

        <form id="survey-form" action="">
            <div class="form-group">
                <label id="name-label" for="name">Name</label>
                <input class="form-control" type="text" id="name" name="name" placeholder="Enter your name" required />
            </div>
            <div class="form-group">
                <label id="email-label" for="email">Email</label>
                <input class="form-control" type="email" id="email" name="email" placeholder="Enter your email" required />
            </div>
            <div class="form-group">
                <label id="age-label" for="age">Age (optional)</label>
                <input class="form-control" type="number" id="age" name="age" placeholder="Age" />
            </div>
            <div class="form-group">
                <label for="role">Which option best describes your current role?</label>
                <select class="form-control" id="role" name="role">
                    <option class="default-option">Select current role</option>
                    <option value="student">Student</option>
                    <option value="fulltimejob">Full Time Job</option>
                    <option value="fulltimelearner">Full Time Learner</option>
                    <option value="prefernottosay">Prefer not to say</option>
                    <option value="other">Other</option>
                </select>
            </div>
            <div class="form-group">
                <label id="number-label" for="number">Number</label>
                <input class="form-control" type="number" id="number" name="number" placeholder="Enter your number" required />
            </div>
            <div class="form-group">
                <label>Would you recommend freecodecamp to a friend?</label><br>
                <input id="definitely" type="radio" name="recommendation" value="definitely" />
                <label for="definitely">Definitely</label><br>
                <input id="maybe" type="radio" name="recommendation" value="maybe" />
                <label for="maybe">Maybe</label><br>
                <input id="notsure" type="radio" name="recommendation" value="not sure" />
                <label for="notsure">Not sure</label>
            </div>
            <div class="form-group">
                <label for="feature">What is your favorite feature of freeCodeCamp?</label>
                <select class="form-control" id="feature" name="feature">
                    <option class="default-option">Select an option</option>
                    <option value="student">Challenges</option>
                    <option value="fulltimejob">Projects</option>
                    <option value="fulltimelearner">Community</option>
                    <option value="prefernottosay">Open Source</option>
                    <option value="other">Other</option>
                </select>
            </div>
            <div class="form-group">
                <label for="">What would you like to see improved? (Check all that apply)</label><br>
                <input type="checkbox" name="improvement" id="front-end-projects" />
                <label for="front-end-projects">Front-end Projects</label><br>
                <input type="checkbox" name="improvement" id="back-end-projects" />
                <label for="back-end-projects">Back-end Projects</label><br>
                <input type="checkbox" name="improvement" id="data-visualization" />
                <label for="data-visualization">Data Visualization</label><br>
                <input type="checkbox" name="improvement" id="challenges" />
                <label for="challenges">Challenges</label><br>
                <input type="checkbox" name="improvement" id="open-source-community" />
                <label for="open-source-community">Open Source Community</label><br>
                <input type="checkbox" name="improvement" id="gitter-help-rooms" />
                <label for="gitter-help-rooms">Gitter help rooms</label><br>
                <input type="checkbox" name="improvement" id="videos" />
                <label for="videos">Videos</label><br>
                <input type="checkbox" name="improvement" id="city-meetups" />
                <label for="city-meetups">City Meetups</label><br>
                <input type="checkbox" name="improvement" id="forum" />
                <label for="forum">Forum</label><br>
                <input type="checkbox" name="improvement" id="additional-courses" />
                <label for="additional-courses">Additional Courses</label><br>
            </div>
            <div class="form-group">
                <label for="comments">Any Comments or Suggestions?</label><br>
                <textarea class="form-control" placeholder="Enter your comment here..."></textarea>
            </div>
            <div class="form-group">
                <input class="form-control" id="submit" type="submit" value="Submit">
            </div>

        </form>
    </main>

              
            
!

CSS

              
                * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

main {
    padding: 1rem 2rem;
    color: white;
    background-color: rgb(31, 32, 100);
}

#title,
#description {
    text-align: center;
}

form {
    background-color: rgba(8, 8, 63, 0.8);
    padding: 2rem;
    border-radius: 8px;
    max-width: 780px;
    margin: 2rem auto;
}

.form-group {
    padding: 10px 0 0 0;
}

.form-control {
    display: block;
    width: 100%;
}

input[type="text"],
input[type="number"],
input[type="email"],
select {
    border: none;
    border-radius: 3px;
    padding: 8px 12px;
    font-weight: 500;
}

label {
    font-weight: 500;
}

textarea {
    width: 100%;
    height: 100px;
    border: none;
    padding: 8px 12px;
    font-weight: 500;
}

input[type="submit"] {
    border: none;
    outline: none;
    padding: 8px 12px;
    font-weight: 500;
    border-radius: 5px;
    color: white;
    background-color: rgb(5, 5, 31);
    cursor: pointer;
    margin-top: 1rem;
}
              
            
!

JS

              
                
              
            
!
999px

Console