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

              
                <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="SurveyForm-style.css">
    <title>Survey Form</title>
</head>
<body>
    <div class="container">
        <header>
            <h1 id="title">Best Browser Form</h1>
            <p id="description">A form to determine which is the most popular browser in Web Development</p>
        </header>
    
        <form id="surveyform">
            <div class="form-container" id="name-container">
    
                <label for="name" id="name-label"> Name:</label>
                <br>
                <input type="text"
                class="form-input"
                id="name"
                name="name"
                placeholder="Enter your full name"
                required>
    
            </div>
    
            <div class="form-container" id="email-container">
                <label for="email" id="email-label"> Email:</label>
                <br>
                <input type="email"
                class="form-input"
                id="email"
                name="email"
                placeholder="Enter your email adress"
                required>
    
            </div>
    
            <div class="form-container" id="number-container">
                <label for="number" id="number-label"> Phone number:</label>
                <br>
                <input type="number"
                class="form-input"
                id="number"
                name="number"
                placeholder="Enter your phone number"
                min="10"
                max="99">
            </div>
    
            <div class="form-container" id="dropdown-container">
            <p> Which of the following browsers do you use most <em>when working on a project</em>?</p>  
            <select name="browser" id="dropdown">
                <option value="chrome">Google Chrome</option>
                <option value="firefox">Firefox</option>
                <option value="safari">Safari</option>
                <option value="edge">Microsoft Edge</option>
                <option value="other">Other</option>
            </select>
            </div>
    
            <div class="form-container" id="radio-container">
                <p>How likely are you to recommend your current browser to a friend or coworker?</p>

                <label for="vlikely">Very likely </label>
                <input
                id="vlikely"
                name="recommend-status"
                type="radio"
                value="very-likely"
                checked>

                <label for="slikely">Somewhat likely </label>
                <input
                id="slikely"
                name="recommend-status"
                type="radio"
                value="somewhat-likely">
                
                <label for="nvlikely">Not very likely </label>
                <input
                id="nvlikely"
                name="recommend-status"
                type="radio"
                value="not-very-likely">

                <label for="vunlikely"> Very unlikely </label>
                <input
                id="vunlikely"
                name="recommend-status"
                type="radio"
                value="Very unlikely">
            </div>
    
            <div class="form-container" id="checkbox-container">
            <p> What lead you to choose that browser above other options?</p>

                <label for="default">It was the default browser in my computer </label>
                <input
                id="default"
                name="qualities"
                type="checkbox"
                value="default-browser">
    
                <label for id="features">It contains features which help me in the task of web development</label>
                <input
                id="features"
                name="qualities"
                type="checkbox"
                value="better-features">

                <label for="aesthetics">The look of the browser is aesthetically pleasing </label> 
                <input
                id="aesthetics"
                name="qualities"
                type="checkbox"
                value="aesthetically-superior">
    
                <label for="faster">The browser completes tasks in a fast and efficient manner</label>
                <input
                id="faster"
                name="qualities"
                type="checkbox"
                value="faster-efficient">
            </div>
            <div class="form-container" id="textarea-container">
                <p>Any comments or suggestions?</p>
                <textarea
                  id="comments"
                  class="input-text-area"
                  name="comment"
                  placeholder="Enter your comment here..."
                ></textarea>
            </div>
            
            <div class="form-container" id="button-container">
                <button type="submit" id="submit">
                    Submit
                </button>
            </div>
        </form>
    </div>
</body>
</html>


              
            
!

CSS

              
                /*#E8C25A*/


body {
    margin: 0px;
    font-family: Rubik, sans-serif;
    font-weight: 400;
    color: #030508;
}

.container {
    width: 70%;
    margin: 3rem auto;
    background-color: #F9F9F9;
    border: #030508 1px solid;
    border-radius: 30px; 
}

.container header {
    margin: 20px auto;
    text-align: center;
}

.container header p {
    padding:5px 10px;
    margin-bottom: 0px;
}


.form-container label {
    margin: 20px 0px;
    padding: 0px 1px;
    font-size: 1rem;
}

.form-container input {
    margin: 1rem 0px;
    font-size: 1rem;
    max-width: 100%;
}

.form-container [type="text"],
.form-container [type="number"],
.form-container [type="email"] {
    box-sizing: content-box;
    margin: 1rem 0rem;
    padding: 0px 1px;
    border: 2px solid transparent;
    border-radius: 4px;
    height: 2rem;
    transition: border 200ms ease-in-out;}

.form-container [type="text"]:hover,
.form-container [type="number"]:hover,
.form-container [type="email"]:hover {
    border: 2px solid #375BA9 ;
}

.form-container [type="text"]:focus,
.form-container [type="number"]:focus,
.form-container [type="email"]:focus{
    border: 2px solid #375BA9;
    outline: 0px solid transparent;}


#title {
    box-sizing: border-box;
    width: 60%;
    margin: 30px auto;
    margin-bottom: 10px;
    font-size: 2.8rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: border-bottom 200ms ease-in-out;}

#title:hover {
    border-bottom: 1px solid #375BA9;
}

#description {
    font-size: 0.9rem;
}

#surveyform {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: start;
    gap: 10px;
    padding: 30px;
    margin: 1rem auto;
    font-size: 1rem
}

.form-container {
    width: 100%
}

.form-container input {
    width: 100%;
}


.form-container {
    box-sizing: border-box;
    margin: 1.5rem auto;
}


.input-text-area {
    width: 80%;
}

#surveyform > * {
    margin: 1rem 0px;
}

#name-container {
    grid-column: 1 / 2;
    max-width: 90%;
}

#name-container input {
    width: 100%
}

#email-container {
    grid-column: 2 / 3;
    max-width: 90%;
}

#email-container input {
    width: 100%
}

#number-container {
    grid-column: 1 / 3 ;
    width: 100%
}

#number-container input {
    width: 100%
}

#dropdown-container {
    grid-column: 1 / 3 ;
    width: 100%;
}

#radio-container {
    grid-column: 1 / 3 ;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: auto 1fr;
    width: 100%;
    justify-items: left;
    align-items: center;
}

#radio-container p {
    grid-column: 1 / 3;
}

#radio-container input {
    max-width: 12px;
    margin-left: 15px;
}

#checkbox-container {
    grid-column: 1 / 3;
    display: grid;
    gap: 0.6rem;
    grid-template-columns: auto 1fr;
    width: 100%;
    justify-items: left;
    align-items: center;
}

#checkbox-container p {
    grid-column: 1 / 3;
}

#checkbox-container input {
    max-width: 12px;
    margin-left: 15px;
}

#textarea-container {
    grid-column: 1 / 3;
}

#textarea-container textarea {
    resize: none;
    width: 100%;
}

#button-container {
    grid-column: 1 / 3;
}

#button-container button {
    height: 3rem;
    font-size: 1.2rem;
    font-weight: 500;
    color: #F0F3FA;
    border-radius: 8px;
    background-color: #2D4B8B;
    font-family: Rubik, sans-serif;
    display: block;
    margin: 0px auto;
    width: 100%;
    padding: 5px 0px;
}
              
            
!

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