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>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Travel Survey</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" media="screen" href="survey-style.css" />
</head>
<body>
    <header>
        <h1 id="title">Do you love to travel?</h1>
        <p id="description"><strong>Then fill out this survey!</strong></p>
    </header>
    <form id="survey-form" method="GET">
        <div class="first_tab">
            <div class="labels">
                <label id="name-label" for="name">Name:</label>
            </div>
        <div class="right_tab">
            <input type="text" name="name" id="name" class="input-field" placeholder="Enter your name" required>
        </div>
        </div>
        <div class="first_tab">
            <div class="labels">
                <label id="email-label" for="email">E-mail:</label>
            </div>
        <div class="right_tab">
            <input type="email" name="email" id="email" class="input-field" placeholder="Enter your e-mail" required>
        </div>
        </div>
        <div class="first_tab">
            <div class="labels">
                <label id="number-label" for="number">Age</label>
            </div>
        <div class="right_tab">
            <input autofocus type="number" name="age" id="number" class="input-field" min="1" max="100" placeholder="Age" required>
        </div>
        </div>
        <div class="first_tab">
            <div class="labels">
                <label for="continents">Which of the continents fascinates you the most?</label>
            </div>
        <div class="right_tab">
                <select id="continents" name="continents">
                    <option disabled selected value="Select an option">Select an option</option>
                    <option value="America">America</option>
                    <option value="Africa">Africa</option>
                    <option value="Asia">Asia</option>
                    <option value="Europe">Europe</option>
                    <option value="Oceania">Oceania</option>
                </select>
        </div>
        </div>
        <div class="first_tab">
            <div class="labels">
                <label for="dropdown">In which season do you prefer to travel?</label>
            </div>
        <div class="right_tab">
            <select id="dropdown" name="seasons">
            <option disabled selected value="Select an option">Select an option</option>
            <option value="Spring">Spring</option>
            <option value="Summer">Summer</option>
            <option value="Autumn">Autumn</option>
            <option value="Winter">Winter</option>
        </select>
        </div>
        </div>
        <div class="first_tab">
                <div class="labels">
                    <label for="holidays">Where do you prefer to spend your holidays?</label>
                </div>
        <div class="right_tab">
            <ul id="holidays" style="list-style: none;">
                <li><label><input name="radio-buttons" value="1" type="radio">At Home</label></li>
                <li><label><input name="radio-buttons" value="2" type="radio">At the sea</label></li>
                <li><label><input name="radio-buttons" value="3" type="radio">At the mountain</label></li>
                <li><label><input name="radio-buttons" value="4" type="radio">At the river</label></li>
            </ul>
            </div>
            </div>
            <div class="first_tab">
                <div class="labels">
                    <label for="preferences">What do you prefer to do during a trip?</label>
                </div>
            <div class="right_tab">
                <ul id="preferences" style="list-style:none;">
                <li><label><input name="prefer" value="1" type="checkbox">Just relaxing</label></li>
                <li><label><input name="prefer" value="2" type="checkbox">Visit the place and take some photos</label></li>
                <li><label><input name="prefer" value="3" type="checkbox">See the architecture and/or the temples of the place</label></li>
                <li><label><input name="prefer" value="4" type="checkbox">Taste the local food</label></li>
                <li><label><input name="prefer" value="5" type="checkbox">Discover the tradition of the place</label></li>
                <li><label><input name="prefer" value="6" type="checkbox">Meet new people</label></li>
                </ul>
            </div>
            </div>
            <div class="first_tab">
                <div class="labels">
                    <label for="dream">Let me know what your deam destination is</label>
                </div>
                <div class="right_tab">
                    <textarea id="dream" style="height:50px" name="comment" placeholder="Enter your comment here..."></textarea>
                </div>
            </div>
            <footer>
            <button id="submit" type="submit">Submit</button>
            </footer>
    </form>
</body>
</html>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Montserrat');

html, body{
    font-family: 'montserrat', 'sans-serif';
    background: linear-gradient(to top, #5f2c82, #49a09d);
    background-repeat: no-repeat;
    background-attachment: fixed;
}

header{
    text-align: center;
    color: #ffffff;
}
form{
    background-color: rgba(250, 250, 250, 0.7);
    margin: auto;
    border-radius: 10px;
    width: 70%;
    padding: 10px;
}
.labels {
    display: inline-block;
    text-align: right;
    width: 40%;
    padding: 5px;
    vertical-align: top;
    margin-top: 10px;
  }
.right_tab {
    display: inline-block;
    text-align: left;
    width: 50%;
    vertical-align: middle;
    padding-left: 20px;
  }
.input-field{
      padding-left: 5px;
      height: 23px;
      width: 250px;
 }

#continents, #dropdown{
    height: 35px;
    width: 250px;
}
#holidays, #preferences{
    padding-left: 0px;
}
textarea{
    width: 260px;
}
#dream{
    padding-left: 5px;
}
#submit{
    color: #ffffff;
    font-size: 1em;
}
button{
    position: relative;
    left: 45%;
    background-color: #5f2c82;
    border: 2px solid #5f2c82;
    border-radius: 8px;
    width: 90px;
    height: 40px;
    margin: 20px;
}
@media screen and (max-width: 600px){
  
  .labels{
  width: 100%;
  text-align: left;
  }
  form{
    width: 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