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>
  <head>
    <title>Ideal Dog Survey</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://fonts.googleapis.com/css?family=Lora:400,700|Montserrat:300i,400,600|Nanum+Gothic:400,700" rel="stylesheet">
    <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
  </head>
  
  <body class="bg-img">
    <main>
      <header>
        <h1 id="title">Finding Your New Best Friend</h1>
        <p id="description">Thank you for your interest in adopting from one of our reputible breeders! We're excited to help you find your new best friend. In order to match you with the best breeder and dog, please fill out our survery below.</p>
      </header>
      
      <form id="survey-form">
        
        <div class="question-group">
          <label for="name" id="name-label">Name: </label>
          <input type="text" id="name" placeholder="Last Name, First Name" required>
        </div>
        <div class="question-group">
          <label for="email" id="email-label">Email: </label>
          <input type="email" id="email" placeholder="Valid Email" required>
        </div>
        <div class="question-group">
          <label for="number" id="number-label">People in Household: </label>
          <input type="number" id="number" placeholder="Number" min=1 max=10>
        </div>
        
        <div class="question-group">
          <label for="kids">Are there any children in the household?</label>
          <br>
          <label><input type="radio" id="kids" name="kids" value="1">Yes, 5 years old or younger</label><br>
          <label><input type="radio" id="kids" name="kids" value="2">Yes, 6-9 years old</label><br>
          <label><input type="radio" id="kids" name="kids" value="3">Yes, 10-14 years old</label><br>
          <label><input type="radio" id="kids" name="kids" value="4">Yes, 15-18 years old</label><br>
          <label><input type="radio" id="kids" name="kids" value="5">No children</label>
        </div>
        
        <div class="question-group">
          <label for="dropdown">What type of home do you live in?</label>
          <select name="dropdown" id="dropdown">
            <option>Studio Apt</option>
            <option>One Bedroom Apt</option>
            <option>Two+ Bedroom Apt</option>
            <option>House</option>
            <option>Other</option>
          </select><br>
          <label for="name" id="other">If Other, please describe: </label>
          <input type="text" id="other-box" placeholder="Describe">
          </div>
        
        <div class="question-group">
          <label for="age">How old would you like your new dog to be?</label>
          <br>
            <label><input type="radio" id="age" name="age" value="1">Puppy</label><br>
            <label><input type="radio" id="age" name="age" value="2">Young</label><br>
            <label><input type="radio" id="age" name="age" value="3">Adult</label><br>
            <label><input type="radio" id="age" name="age" value="4">Senior</label>
        </div>
        
        <div class="question-group">
          <label for="active">How active will you commit to be with your new dog?</label><br>
            <label><input type="radio" id="active" name="active" value="1">Extremely</label><br>
            <label><input type="radio" id="active" name="active" value="2">Very</label><br>
            <label><input type="radio" id="active" name="active" value="3">Average</label><br>
            <label><input type="radio" id="active" name="active" value="4">Somewhat</label>
        </div>
        
        <div class="question-group">
          <label for="breed">What breed(s) of dog(s) are you most interested in?</label>
          <br>
          <label for="terrier"><input id="breed" type="checkbox" name="breed" value="1"><div class="tooltip">Terrier Group<span class="tooltiptext">Feisty, Sassy, Energetic, Bred to guard, Can be stubborn, ideal for single-pet homes</span></div>, like the Scottish Terrier, Norfolk Terrier, Norwich Terrier, Am Staff</label>
          <br>
          <label for="toy"><input id="breed" type="checkbox" name="breed" value="2"><div class="tooltip">Toy Group<span class="tooltiptext">Small size-Big personality, Affectionate, Sociable, Charming, Adaptable, Good for apartments</span></div>, like the Chihuahua, Chinese Crested, Pug, Pomeranian, Affenpinscher</label>
          <br>
          <label for="working"><input id="breed" type="checkbox" name="breed" value="3"><div class="tooltip">Working Group<span class="tooltiptext">Fast learners, Powerful, Fearless, Protective, Not always suitable for first-time dog owners</span></div>, like the Siberian Husky, Great Dane, Doberman Pinscher</label>
          <br>
          <label for="sporting"><input id="breed" type="checkbox" name="breed" value="4"><div class="tooltip">Sporting Group<span class="tooltiptext">Well-Rounded Companions, Alert, Highly Active, Friendly, Instinctive</span></div>, like the Brittany, Golden Retriever, Vizsla, Cocker Spaniel</label>
          <br>
          <label for="hound"><input id="breed" type="checkbox" name="breed" value="5"><div class="tooltip">Hound Group<span class="tooltiptext">Driven by smell, High Stamina, Loud, Diverse, Bred for the Hunt, Best in a fenced-in area</span></div>, like the Beagle, Dachshund, Greyhound, Saluki, English Foxhound</label>
          <br>
          <label for="herding"><input id="breed" type="checkbox" name="breed" value="6"><div class="tooltip">Herding Group<span class="tooltiptext">Will Herd Anything-Including Kids, Trainable, Loyal, High Intelligence, Up for anything</span></div>, like the Australian Shepherd, German Shepherd, Beauceron</label>
          <br>
          <label for="non-sporting"><input id="breed" type="checkbox" name="breed" value="7"><div class="tooltip">Non-Sporting Group<span class="tooltiptext">Unique personalities, Wide variety of backgrounds, Good watchdogs and housedogs, Hard to generalize</span></div>, like the Dalmatian, Shiba Inu, Chow Chow, Boston Terrier</label>
        </div>
        
        <div class="text-area">
          <label class="option-question" for="comments">Any thing else we should know?</label>
          <br>
          <textarea name="comment" id="comments" cols="33" rows="5" placeholder="Enter extra information here"></textarea>
        </div>
        
        <div class="final">
          <p>Thank you for taking the time to fill out our form. Please look over your entries and click Submit once everything is correct. We will contact you within 7-10 business days with potential breeders we think would suit your requests and needs. For any other questions, please visit our contact page.</p>
        </div>
        
        <button type="submit" id="submit" value="submit">Submit</button>
        
      </form>
    </main>
  </body>
  
  
</html>


              
            
!

CSS

              
                *{
  margin: 0;
  max-width: 100%;
}

body{
  display: flex;
  flex-direction:column;
  background-color: #d1e0e0;
}

.bg-img {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  margin-top: -14px;
}

.bg-img::after {
  content: "";
  background: url(https://us.123rf.com/450wm/karenr/karenr1509/karenr150900159/45591735-green-dog-paw-prints-puppy-bone-and-hearts-tile-pattern-repeat-background-that-is-seamless-and-repea.jpg?ver=6);
  opacity: 0.4;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  position: absolute;
  z-index: -1; 
  max-width: 100%;
}

header{
  text-align: center;
}


h1{
  color: #005ce6;
  text-shadow: 1px 1px #000;
  font-family: Nanum Gothic;
  font-size: 3em;
  font-weight: 600;
  margin-top: 15px;
  margin-left: 8%;
  margin-right: 8%;
  padding-top: 10px;
}

#description{
  color: #fff;
  background-color: #787888;
  border-radius: 7px;
  border: 1.5px solid #fff;
  font-family: Montserrat;
  font-size: 1.15em;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 5%;
  margin-right: 5%;
  padding: 5px;
}

#survey-form{
  border-radius: 7px;
  margin-bottom: 2em;
  margin-left: 5%;
  margin-right: 5%;
}

.question-group{
  display: block;
  background-color: #004466;
  color: white;
  font-family: Lora;
  padding:15px;
  margin-bottom: 15px;
  border: 1.5px solid #fff;
  border-radius: 5px;
}

.question{
  text-align: center;
}

#other-box{
  margin-top: 10px;
  margin-left: 67px;
}

input#number{
  width: 65px;
}

#age, #active, #kids, #breed{
  margin-right: 5px;
}

/*Tooltip for Breeds Section*/
.tooltip {
  position: relative;
  display: inline-block;
  border-bottom: 1px dotted #fff;
}

.tooltip .tooltiptext {
  visibility: hidden;
  font-size: 0.75em;
  width: 200px;
  background-color: #d1e0e0;
  color: black;
  text-align: center;
  border-radius: 3px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  top: -5px;
  left: 110%;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  margin-top: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent black transparent transparent;
}
.tooltip:hover .tooltiptext {
  visibility: visible;
}

.text-area{
  display: inline-block;
  text-align: center;
  font-family: Lora;
  color: white;
  background-color: #004466;
  border: 1.5px solid #fff;
  border-radius: 5px;
  padding: 6px;
  margin-left: 2%;
  margin-bottom: 15px;
}

.final {
  text-align: center;
  color: #fff;
  background-color: #787888;
  border-radius: 7px;
  border: 1.5px solid #fff;
  font-family: Montserrat;
  font-size: 1.15em;
  padding: 3px;
}

#submit{
  display: block;
  position: center;
  background-color: #005ce6;
  border: 3px solid #787888;
  border-radius: 5px;
  font-family: Nanum Gothic;
  font-weight: 700;
  font-size: 1.5em;
  color: white;
  width: 200px;
  height: 50px;
  margin: 1em 20% 0 20%;
}

#submit-button:hover{
  color:  #005ce6;
  background-color: #fff;
  border: 3px solid #787888;
}

@media screen and (min-width:540px){
  #description{
    margin-left: 20%;
    margin-right: 20%;
  }
  
  .question-group{
    margin-left: 20%;
    margin-right: 20%;
  }
  
  .text-area{
    display: block;
    position: center;
    margin-left:20%;
    margin-right: 20%;
  }
  
  .final{
    margin-left: 15%;
    margin-right: 15%;
  }
  
  #submit-button{
    margin-left: 42%;
  }
}
              
            
!

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