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>

<body>
    <header id="heading">
        <h1 id="title">Crazy Survey Form</h1>
        <p id="description">You are crazy for taking this accessible survey</p>
    </header>
    <main id="main">
        <form id="survey-form">
            <div class="form-group">
                <label id="name-label" for="name">N<span style="text-decoration: underline">a</span>me</label>
                <input accesskey="a" class="text-input" id="name" name="name" type="text" placeholder="Enter your name" required>
            </div>
            <div class="form-group">
                <label id="email-label" for="email">E<span style="text-decoration: underline">m</span>ail</label>
                <input accesskey="m" class="text-input" id="email" name="email" type="email" placeholder="Enter your Email" required>
            </div>
            <div class="form-group">
            <label id="number-label" for="number"><span style="text-decoration: underline">2</span> + 2 = ? (Optional)</label>
            <input accesskey="2" class="text-input" id="number" name="age" type="number" min="4" max="4" placeholder="The answer is 5">
            </div>
            <div class="form-group">
            <label for="dropdown">What is your favorite f<span style="text-decoration: underline">o</span>od?</label>
            <select accesskey="o" id="dropdown">
                <optgroup label="Yummy">
                    <option value="frogsBrain">Frog Brain</option>
                    <option  value="monkeyNipples">Monkey Nipples</option>
                    <option  value="cockroachToes">Cockroach Toes</option>
                </optgroup>
                <optgroup label="Disgusting">
                    <option value="cookies">Cookies</option>
                    <option value="icecream">Ice Cream</option>
                    <option value="friedChicken">Fried Chicken</option>
                </optgroup>
            </select>
            </div>
            <div class="form-group">
                <label id="radio-label">How satisfied are you so far?</label>
                <label class="radio-container"><span style="text-decoration: underline">V</span>ery Satisfied<input accesskey="v" type="radio" name="satisfaction" value="verySatisfied"><span class="radio-mark"></span></label>
                <label class="radio-container"><span style="text-decoration: underline">S</span>uper Satisfied<input accesskey="s" type="radio" name="satisfaction" value="superSatisfied"><span class="radio-mark"></span></label>
                <label class="radio-container"><span style="text-decoration: underline">P</span>ure Euphoric<input accesskey="p" type="radio" name="satisfaction" value="inEuphoria" checked><span class="radio-mark"></span></label>
            </div>
            <div class="form-group">
                <label accesskey="l" id="checkbox-label">What is the meaning of life? <span id="check-all">(Check all that apply)</span></label>
                <label class="checkbox-container">I am so hungry<input type="checkbox" name="forFun" value="meh"><span class="checkmark"></span></label>
                <label class="checkbox-container">Actually I just want snacks<input type="checkbox" name="forFun" value="meh"><span class="checkmark"></span></label>
                <label class="checkbox-container">I am a pig<input type="checkbox" name="forFun" value="meh"><span class="checkmark"></span></label>
                <label class="checkbox-container">I don't have a life<input type="checkbox" name="forFun" value="meh"><span class="checkmark"></span></label>
                <label class="checkbox-container">I like playing piano<input type="checkbox" name="forFun" value="meh"><span class="checkmark"></span></label>
            </div>
            <div class="form-group">
            <label accesskey="d" id="comments-label" for="comments">Any death <span style="text-decoration: underline">w</span>ishes?</label>
            <textarea accesskey="w" id="comments">e.g. I want to choke on chocolate cake.</textarea>        
            <input id="submit" name="submit" type="submit" value="Submit">
            </div>
        </form>
    </main>
</body>
              
            
!

CSS

              
                html, body, header, label, input, form, h1, h2, p, option, optgroup, select, textarea, form
{
    margin: 0px 0px 0px 0px;
    padding: 0px 0px 0px 0px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: rgb(223, 30, 94);
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-template-columns: auto;
    grid-template-areas: 
    "heading"
    "form";
    justify-content: center;
    align-items: center;
}

#heading {
    grid-area: heading;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 700px;
    min-width: 320px;
    width: 90vw;
    /*background-color: antiquewhite;*/
    color: white;
}

#title{
    font-size: 40px;
    margin-top: 40px;
}

#description{
    margin-bottom: 40px;
    font-style: italic;
    font-size: 20px;
}

#main {
    grid-area: form;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 700px;
    min-width: 320px;
    width: 90vw;
    background-color: rgb(32, 193, 204);;
    color: white;
    border-radius: 5px;
}

#survey-form {
    max-width: 600px;
    min-width: 275px;
    width: 77.1428571vw;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 35px 35px 35px 35px;
}

.form-group {
    display: flex;
    width: 100%;
    flex-direction: column;
    margin-bottom: 20px;
}

label {
    font-size: 20px;
    margin-bottom: 10px;
}

.text-input {
    width: 99.75%;
    height: 40px;
    border: 0px;
    padding-left: 0.25%;
    font-size: 20px;
    background-color: #eee;
    color: grey;
}

#dropdown {
    width: 100%;
    height: 40px;
    border: 0px;
    padding-left: 0.25%;
    font-size: 20px;
    background-color: #eee;
    color: grey;
}

.radio-container {
    display: block;
    position: relative;
    padding-left: 30px;
    margin-top: 5px;
    cursor: pointer;
    font-size: 20px;
    user-select: none;
  }

.radio-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.radio-mark {
  position: absolute;
  top: 0;
  left: 0;
  margin-top: 5px;
  border-radius: 50%;
  height: 20px;
  width: 20px;
  background-color: #eee;
  margin-left: 0.05em;
}

.radio-container:hover .radio-mark {
  background-color: #ccc;
}

.radio-container input:checked ~ .radio-mark {
  background-color: #2196F3;
}

.radio-mark:after {
  content: "";
  position: absolute;
  display: none;
}

.radio-container input:checked ~ .radio-mark:after {
  display: block;
}

.radio-container .radio-mark:after {
  left: 5px;
  top: 5px;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background-color: white;
}

#check-all {
    font-size: 0.8em;
}

.checkbox-container {
    display: block;
    position: relative;
    padding-left: 1.5em;
    cursor: pointer;
    font-size: 20px;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 1em;
    width: 1em;
    background-color: #eee;
    margin-top: 0.25em;
    margin-left: 0.05em;
}

.checkbox-container:hover .checkmark {
    background-color: #ccc;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #2196f3
}

.checkmark::after {
    content:"";
    display: none;
    position: absolute;
}

.checkbox-container input:checked ~ .checkmark::after {
    display: block;
}

.checkbox-container .checkmark::after {
    left: 0.25em;
    top: 0.2em;
    width: 0.25em;
    height: 0.25em;
    border: solid white;
    border-width: 0px 0.2em 0.2em 0px;
    transform: rotate(45deg);
}

textarea {
    min-width: 95%;
    border: 0px solid white;
    padding: 2.5% 2.5% 2.5% 2.5%;
    font-size: 20px;
    height: 5em;
    color: grey;
}

#submit {
    width: 100%;
    height: 50px;
    font-size: 20px;
    background-color: rgb(106, 207, 128);
    border: 0px;
}
              
            
!

JS

              
                
              
            
!
999px

Console