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 id="page-wrapper" class="container">
    <div id="survey-wrapper" class="survey-container">
        <form id="survey-form">
            <div id="title-wrapper" class="inner-container">
                <h1 id="title">Pet Preference Survey</h1>
                <p id="description">Are you a cat person, or a dog person? Chose carefully, dog is watching.</p>
            </div>
            <div id="personal-info-wrapper" class="inner-container">
                <div class="form-group">
                    <label for="name" id="name-label">Name</label>
                    <input
                        type="text"
                        name="name"
                        id="name"
                        class="form-control"
                        placeholder="Enter Your Name"
                        required/>
                </div>
                <div class="form-group">
                    <label for="email" id="email-label">Email</label>
                    <input
                        type="email"
                        name="email"
                        id="email"
                        class="form-control"
                        placeholder="Enter Your Email"
                        required/>
                </div>
                <div class="form-group">
                    <label for="age" id="number-label">Age<span id="clue">(optional)</span></label>
                    <input
                        type="number"
                        name="age"
                        id="number"
                        class="form-control"
                        min="5"
                        max="99"
                        max-width="100px"
                        placeholder="Age"/>
                </div>
                <div class="form-group">
                    <label for='dropdown'>What is your gender?</label>
                    <select id="dropdown" name="gender" class="form-control">
                        <option disabled selected value>Select gender</option>
                        <option value="male">Male</option>
                        <option value="female">Female</option>
                      <option value="other">Other</option></select>    
                </div>
            </div>
            <div id="checkbox-wrapper" class="inner-container">
                <fieldset id='checkbox-row-wrapper' class='checkboxes'>
                  <legend>Chose all that apply</legend>
                    <div id='checkbox-column-left' class='column'>
                      <div class='checkbox-container'>
                      <input
                          name="prefer"
                          id="scratches"
                          value="scratches"
                          type="checkbox"
                          class="input-checkbox"
                             /><label for'scratches'>Scratches</label></div>
                      <div class='checkbox-container'>
                      <input
                          name="prefer"
                          id="kisses"
                          value="kisses"
                          type="checkbox"
                          class="input-checkbox"
                             /><label for'kisses'>Kisses</label></div>
                      <div class='checkbox-container'>
                      <input
                          name="prefer"
                          id="walks"
                          value="walks"
                          type="checkbox"
                          class="input-checkbox"
                             /><label for'walks'>Walks</label></div>
                      <div class='checkbox-container'>
                      <input
                          name="prefer"
                          id="litterboxes"
                          value="litterboxes"
                          type="checkbox"
                          class="input-checkbox"
                             /><label for"litterboxes">Litterboxes</label></div>
                  </div>
                  <div id='checkbox-column-right' class='column'>
                    <div class='checkbox-container'>
                      <input
                          name="prefer"
                          id="meowling"
                          value="meowling"
                          type="checkbox"
                          class="input-checkbox"
                             /><label for'meowling'>Meowling</label></div>
                    <div class='checkbox-container'>
                      <input
                          name="prefer"
                          id="borking"
                          value="borking"
                          type="checkbox"
                          class="input-checkbox"
                             /><label for'borking'>Borking</label></div>
                    <div class='checkbox-container'>
                      <input
                          name="prefer"
                          id="cuddles"
                          value="cuddles"
                          type="checkbox"
                          class="input-checkbox"
                             /><label for'cuddles'>Cuddles</label></div>
                    <div class="checkbox-container">
                      <input
                          name="prefer"
                          id="clawings"
                          value="clawings"
                          type="checkbox"
                          class="input-checkbox"
                             /><label for'clawings'>Clawings</label></div>
                  </div>
                </fieldset>
            </div>
            <div id="radio-wrapper" class="inner-container">
                <div class="form-group">
                    <p id="radio-title">Chose Your Ultimate Favorite</p>
                    <label>
                        <input
                            name="user-favorite"
                            value="dog"
                            type="radio"
                            class="input-radio"
                            checked/>Dog life
                    </label>
                    <label>
                        <input
                            name="user-favorite"
                            value="cat"
                            type="radio"
                            class="input-radio"
                            />Meow
                    </label>
                    <label>
                        <input
                            name="user-favorite"
                            value="other"
                            type="radio"
                            class="input-radio"
                            />Something weird like lizards (we don't judge)
                    </label>
                    </div>    
            </div>
            <div id="comment-wrapper" class="inner-container">
                <div class="form-group">
                    <p id="textarea-label">Any comments about this survey?</p>
                    <textarea
                        id="comments"
                        class="input-textarea"
                        name="comment"
                        placeholder="Enter your comment here..."
                    ></textarea>
                </div>
                <div class="form-group">
                    <button type="submit" id="submit" class="submit-button">Submit</button>
                </div>
            </div>
        </form>    
    </div>          
</main>
              
            
!

CSS

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



* {
  margin: 0;
  padding: 0;
} 

html {
  color: #1c0f13;
  font-size: 1.3em;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

@media (max-width: 600px) {
  html {
    font-size: 15px;
  }
}

.container {
    display: flex;
    background: #6e7e85;
    width: 100%;
    height: 100%;
}

#survey-wrapper {
  display: flex;
  justify-content: center;
  text-align: center;
  background: #e2e2e2;
  padding: 50px;
  margin: 50px auto 50px auto;
  border-radius: 10px;
  max-width: 70vw;
  width: 70vw;
  box-shadow: 5px 10px 10px;
}

.inner-container {
  background: #e2e2e2;
  border-radius: 5px;
  padding: 40px;
  margin: 25px;
  box-shadow: 10px 10px 15px;
  border-style: solid;
  border: raised;
  border-color: #6e7e85;
  border-width: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  padding: 10px;
  margin: 0px;
  max-width: 50vw;
}



#checkbox-row-wrapper {
  display: flex;
  flex-direction: row;
  border: none;
}

.column {
  display: flex;
  flex-direction: column;
  margin: auto;
}

              
            
!

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