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 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.

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:

Screenshot

Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>

<!-- 

Hello Camper!

For now, the test suite only works in Chrome! Please read the README below in the JS Editor before beginning. Feel free to delete this message once you have read it. Good luck and Happy Coding! 

- The freeCodeCamp Team 

-->
<!DOCTYPE html>
<html>
 <head>
  <link rel="stylesheet" type="text/css" href="style.css">
  <title>Traveling Survey</title>
 </head>
 <body>
  <header>
    <h1 id="title">Traveling Survey</h1>
  </header>
  <div id="form-outer">
    <p id="description">Tell us about your favorite country!</p>
    <form action="#" id="survey-form">
      <div id="name">
        <label class= "label" for="Name"> * Name: </label>
        <input class="input-field" type="text" placeholder="Enter your name" required>
      </div>
      <div id="email">
        <label class="label" for="email"> * Email: </label>
        <input class="input-field" type="text" placeholder="Enter your Email" required>
      </div>
      <div id="number">
        <label class="label" for="age"> * Age: </label>
        <input class="input-field" type="number" min="14" max="100" placeholder="Age" required>
      </div>
      <div id="country">
        <label class="label" for="country"> Where are you from? </label>
        <input class="input-field" type="text" placeholder="Country" required>
      </div>
      <div id="dropdown">
        <label class="label" for="current role"> Which option best describes your current role? </label>
        <select class="dropdown" type="dropdown">
          <option disabled value>Select an option</option>
          <option value="student">Student</option>
          <option value="job">Full Time Job</option>
          <option value="learner">Full Time Learner</option>
          <option value="preferNo">Prefer not to say</option>
          <option value="other">Other</option>
        </select>
      </div>
      <div id="like">
        <label class="labelradio" for="like"> Do you like to travel? </label>
        <div class="radio">
          <label class="labelyes"> Yes </label>
          <input class="input-field-radio" type="radio">
        </div>
        <div class="radio">
          <label class="labelno"> No </label>
          <input class="input-field-radio" type="radio">
        </div>
        <div id="number">
          <label class="label" for="number"> How many countries have you visited? </label>
          <input class="input-field" type="number" min="1" max="193" placeholder="Number" required>
        </div>
        <div id="favorite">
          <label class= "label" for="favorite"> What is your favorite country? </label>
          <input class="input-field" type="text" placeholder="Enter your favorite country" required>
        </div>
        <div id="reason">
          <label class="label" for="reason"> What makes it your favorite country? </label>
          <textarea class="input-field" type="comment" style="height:50px;resize:vertical;"placeholder="Reason">
          </textarea>
        </div>
        <button id="submit" type="submit">Submit</button>
    </form>
  </div>
  <footer> Created by Josy H. 2018 </footer>
 </body>
</html>

              
            
!

CSS

              
                body {
  font-family: Helvetica, sans-serif;
  color: #3b4554;
  width: 70%;
  margin: auto;
  padding-top: 25px;
  background-color: #d8a0c0;
  text-align: center;
}
#form-outer {
  background-color: #efeaed;
  border-radius: 4px;
  width: 90%;
  max-width: 900px;
  padding: 10px;
  padding-top: 20px;
  margin: auto;
}
#title {
  text-align: center;
  text-transform: uppercase;
  font-weight: 200;
  padding-bottom: 15px;
  font-size: 250%;
}
#description {
  font-size: 125%;
  text-align: center;
  padding-bottom: 15px;
}
#survey-form {
  font-size: 100%;
}
footer {
  padding-top: 35px;
  padding-bottom: 15px;
  font-size: 80%;
  text-align: center;
}
.labels {
  display: inline-block;
  text-align: right;
  width: 40%;
  padding: 5px;
  vertical-align: top;
  margin-top: 10px;
}
.input-field {
  text-align: left;
  width: 48%;
  vertical-align: middle;
  height: 20px;
  width: 280px;
  padding: 5px;
  margin: 10px;
  border: 1px solid #c0c0c0;
  border-radius: 2px;
}
.dropdown {
  height: 35px;
  width: 140px;
  padding: 5px;
  margin: 10px;
  margin-top: 15px;
  border: 1px solid #c0c0c0;
  border-radius: 2px;
}
.input-field-radio {
  height: 10px;
  position: relative;
}
#submit {
  background-color: #c462b7;
  border-radius: 4px;
  color: white;
  font-size: 1em;
  height: 40px;
  width: 96px;
  margin: 25px;
  border: 0px solid;
}

              
            
!

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
Be the developer your linter thinks you are.

Console