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>

<h1 id="title">Reading Habits Survey</h1>
        <p id="description">Please help us better understand your reading habits</p>
        <form id="survey-form">
            <label for="name" id="name-label">Your name</label><div class="name-group"><input type="text" id="name" name="name" placeholder="Name" required></div>
            <label for="email" id="email-label">Your e-mail</label><div class="email-group"><input type="email" id="email" name="email" placeholder="E-mail" required></div>
            <label for="number" id="number-label">Your age (optional)</label><div class="age-group"><input type="number" id="number" min="10" max=100 name="age" placeholder="Age"></div>
            <div class="dropdown-group"><label for="dropdown">Which type of books do you prefer to read?</label></div><select id="dropdown" name="preferred type" required>
                <option disabled selected value="">Please select a format</option>
                <option value="hardcopy">Hard copy</option>
                <option value="ebook">E-book</option>
                <option value="audiobook">Audiobook</option>
                <option value="other">Other</option>
            </select>
            <p>Do you have a library membership?</p>
            <div class="library"><input type="radio" id="libraryYes" name="library" value="libraryYes"><label for="libraryYes">Yes</label>
            <input type="radio" id="libraryNo" name="library" value="libraryNo"><label for="libraryNo">No</label></div>
            <p>Please select every one of these apps or devices you use:</p>
            <input type="checkbox" id="goodreads" name="goodreads" value="yes"><label for="goodreads">Goodreads</label>
            <input type="checkbox" id="litsy" name="litsy" value="yes"><label for="litsy">Litsy</label>
            <input type="checkbox" id="kindle" name="kindle" value="yes"><label for="kindle">Kindle</label>
            <input type="checkbox" id="kobo" name="kobo" value="yes"><label for="kobo">Kobo</label>
            <p>Are there any other methods you use to track your reading habits?</p>
            <div>
                <textarea id="othermethods" class="othermethods" name="othermethods" placeholder="Please specify..."></textarea>
            </div>
            <div>
                <input type="submit" id="submit" value="Submit">
            </div>
        </form>

              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Muli:ital@0;1&display=swap');

body {
    font-family: 'Muli', sans-serif;
    background: linear-gradient(90deg, #213f54, #3a6a8c, #4f83a8);
}

h1 {
    color: white;
    text-align: center;
    font-size: 2rem;
}

#description {
    color: white;
    text-align: center;
    font-size: 1.5rem;
}

#survey-form {
    text-align: center;
    font-weight: bold;
}

#name {
    text-align: left;
    font-size: 1.2rem;
    width: 500px;
    height: 30px;
    margin: 10px;
    border-radius: 5px;
}

#email {
    text-align: left;
    font-size: 1.2rem;
    width: 500px;
    height: 30px;
    margin: 10px;
    border-radius: 5px;
}

#number {
    text-align: left;
    font-size: 1.2rem;
    width: 500px;
    height: 30px;
    margin: 10px;
    border-radius: 5px;
}

#dropdown {
    text-align: left;
    font-size: 1.2rem;
    width: 500px;
    height: 30px;
    margin: 10px;
    border-radius: 5px;
}

textarea {
    text-align: left;
    font-size: 1.5rem;
    width: 500px;
    height: 100px;
    margin: 10px;
    border-radius: 5px;
}

input[type=radio] {
    width: 15px;
    height: 15px;
}

input[type=radio]:hover {
    cursor: pointer;
}

input[type=checkbox] {
    width: 15px;
    height: 15px;
    border-radius: 5px;
}

input[type=submit] {
    width: 500px;
    height: 30px;
    margin: 10px;
    border-radius: 5px;
    background-color: #fa002a;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    border: 0px;
}

input[type=submit]:hover {
    cursor: pointer;
    background-color: #c20020;
}
@media (max-width: 500px){
  #name {
    max-width: 80%;
  }
  
  #email {
    max-width: 80%;
  }
  
  #number {
    max-width: 80%;
  }
  
  #dropdown {
    max-width: 80%;
  }
  
  textarea {
    max-width: 80%;
  }
  
  input[type=submit] {
    max-width: 80%;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console