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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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>
<head>
  <title>Basic survey form project</title>
  
  <body class="container">
    <header class="header">  
      <h1 id="title"class="text-center">Do you speak C A T ?</h1>
      <p id="description" class="description text-center" style="text-align: center">A short survey to determine human-feline relations</p>
    </header>
    <form id="survey-form" action="url-where-results-should-go" >
      <div class="form-group">
        <label for="name" id="name-label">Name
        <input 
              id="name" 
              type="text" 
              placeholder="Favorite cat name"
              class="form-control"
              required></label>
      </div>
      <div class="form-group">
        <label for="email" id="email-label"> Email 
        <input 
             id="email" 
             type="email" 
             placeholder="Valid email address"
             class="form-control" 
             required></label>
      </div>
      <div class="form-group">
        <label for="number" id="number-label"> Number of cats owned 
        <input 
             id="number" 
             type="number" 
             min="1" 
             max="100" 
             class="form-control" 
             placeholder="Between 1 & 100!"></label>
      </div>
      <div class="form-group">
        <p>Your typical pet</>
          <select name="pet" id="dropdown" class="form-select" required> 
          <option disabled value>Select An Option</option>
          <option value="owner">Garfield</option>
          <option value="fan">Crookshanks</option>
          <option value="artist">Puss in Boots</option>
          <option value="master">Mufasa</option>
          </select>
      </div>
      <div class="form-group">
        <p>Your cat's personality type</p>
        <label for="personality" id="personality">
        <input 
              type="radio" 
              name="personality"
              value="1"
              class="input-radio">Agreeable</label>
      <label>
      <input type="radio" 
             name="personality"
             value="2"
             class="input-radio">Dominant</label>
      <label>
      <input type="radio" 
             name="personality"
             value="3"
             class="input-radio">Impulsive</label>
      <label>
      <input type="radio" 
             name="personality"
             value="4"
             class="input-radio">Neurotic</label>
      </div> 
        <p>How speaks your feline?</p>
        <label>
        <input type="checkbox" 
              name="vocalising" 
              value="1"
              class="input-checkbox">Purr</label>
        <label>
        <input type="checkbox" 
              name="vocalising" 
              value="2"
              class="input-checkbox">Meow</label>
        <label>
        <input type="checkbox" 
              name="vocalising" 
              value="3"
              class="input-checkbox">Hiss</label>
        <label>
        <input type="checkbox" 
              name="vocalising" 
              value="4"
              class="input-checkbox">Chirp</label>
      </div>
      <div class="form-group">
        <p>Share your best cat pun here</p>   
        <textarea 
             placeholder="If you're feline up to it"
             name ="comment"
             id="comment">
        </textarea>
      </div> 
   
      <div class="form-group">
        <button id="submit"
                type="submit">Submit</button>
      </div>  
    </form>
  </body>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Architects+Daughter&display=swap');
:root {
  --color-cream: #F5F0D3;
  --color-darkgrey: #83807A;
  --color-lightbrown: #C9974C;
  --color-darkorange: #FF6F00;
}

h1,h2 {
  text-align: center;
}

p {
  text-align: left;
}

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

form {
  display: grid;
  grid-template-columns: ;
  grid-template-rows: ;
  box-sizing: border-box;
  padding: 60px;
  margin: 80px 80px;
  border: 5px solid #83807A;
  border-radius: 15px;
  box-shadow: 0 0 15px 20px rgba(0,0,0,0.6);
  background:  #F5F0D3;
  max-width: 620px
}    



body {
  font-family: 'Architects Daughter', cursive;
  font-size: 1rem;
  font-weight: 400;
  line-height 1.4;
  
  
  
  
  
} 

  body::before {
  content: "";
  background-image: url("https://i.pinimg.com/564x/3b/0a/15/3b0a15b7c3b02efa6dae69aa9f257f07.jpg");
    
  opacity: 0.4;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  position: absolute;
  z-index: -1;
}  
body::after {
  content: "";
  background-image: url("https://i.pinimg.com/564x/3b/0a/15/3b0a15b7c3b02efa6dae69aa9f257f07.jpg");
    
  opacity: 0.4;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  position: absolute;
  z-index: -1;

  
.container {
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  width: 80%;
  height: 900px;
  
}


input[type=text],[type=email],[type=number] {
  display: block;
  width: 50%;
  padding: 10px 10px;
  margin: 5px 0;
  box-sizing: border-box;
}

textarea {
  resize: vertical;
}   
button {
  background-color: #FF6F00; 
  border: none;
  color: white;
  padding: 15px 32px;
  margin: 20px 0;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
}
              
            
!

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