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>

<!-- 

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 

-->

<link href="https://fonts.googleapis.com/css2?family=Dosis:wght@600;700;800&display=swap" rel="stylesheet">

<html>
  <body>
    
    <div class="container">
      <div class="form-layout">
        <header>

            <h1 id="title">How was your stay?</h1>
 
          <p id="description">Please let us know</p>
        </header> 

        <form id="survey-form">
          
          <div class="form-items"> 
            <label id="name-label" for="name">Name : </label>
            <input type="text" id="name" placeholder="Full Name" required>
          </div> 
          
          <div class="form-items">
            <label id="email-label" for="email">e-mail : </label>
            <input type="email" id="email" placeholder="e-mail" required>          
          </div>
          
          <div class="form-items">
            <label id="number-label" for="number">Rating : </label>
            <input type="number" id="number" placeholder="1 to 5 Stars" min="1" max="5">  
            <span class="rating-star">⭐'Stars'</span>
          </div>
          
          <div class="form-items">
            <label id="dropdown" for="number">Reason for visit : </label>
            <select type="dropdown" id="dropdown" required>  
              <option>Vacation</option>
              <option>Business</option>
              <option>Conference</option>
              <option>Other</option>
            </select>  
          </div>
          
          <div class="form-items form-group">
            <p>Would you visit again?</p>
            <label>
              <input 
                  name="user-recomended"
                  value="yes"
                  type="radio"
                  class="hold"  
                  checked   
                     > Yes
              </label>
              <label>
              <input 
                  name="user-recomended"
                  value="no"
                  type="radio"
                  class="hold"  
                     > No
              </label>
              <label>
              <input 
                  name="user-recomended"
                  value="maybe"
                  type="radio"
                  class="hold"  
                     > Maybe
              </label>
          </div>
          
          <div class="form-items header-check-box">
            <p class="span">What attractions, attracted you?</p><span class="span">😉</span>
          </div>
            
          <div class="form-items"> 
            <label id="checkbox-1" for="checkbox-1">Sailing : </label>
            <input type="checkbox" id="checkbox-1" value="sailing">
          </div>   
          <div class="form-items"> 
            <label id="checkbox-2" for="checkbox-2">Golfing : </label>
            <input type="checkbox" id="checkbox-2" value="golfing ">
          </div>    
          <div class="form-items"> 
            <label id="checkbox-3" for="checkbox-3">Beach : </label>
            <input type="checkbox" id="checkbox-3" value="beach">
          </div>           
          <div class="form-items"> 
            <label id="checkbox-4" for="checkbox-4">Museum : </label>
            <input type="checkbox" id="checkbox-4" value="museum">
          </div>       
          
          
          <div class="form-items textaera">
              <p>Comments & suggestions</p>
              <textarea  name="textaera" rows="5" col="10"></textarea>
          </div>
          
          <div class="submit-btn">
            <input type="submit" id="submit" class="btn">
          </div>
          
          </div>          
        </form>  
       </div> 
    </div>
  </body>
</html>
              
            
!

CSS

              
                body {
  color: whitesmoke;
  font-size: 16px;
  text-shadow: 1px 1px 1px black;
  font-family: 'Dosis', sans-serif;
  height: 1000px;
  background-color: rgba(0, 75, 200, 1);
  background-image: 
    linear-gradient(to bottom, rgba(100, 150, 200, 1), rgba(100, 100, 250, .5)),

    url(https://images.pexels.com/photos/258154/pexels-photo-258154.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.container {
/*   border: 3px solid green; */
  height: 1000px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

header {
/*    border: 3px solid red; */
   text-align: center;
}

form {
/*   border: 3px solid blue; */
  display: flex;
  flex-direction: column;
  width: 250px;
}

.form-layout {
/*   border: 3px solid orange; */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 260px;
  background-color: hsla(225, 100%, 25%, .5);
  padding: 15px;
  border-radius: 5%;
  box-shadow: 3px 3px 3px black;
}

.form-items {
/*   border: 1px solid yellow; */
  display: flex;
  align-self: flex-start;
  margin: 5px 0;
}

.form-group {
  flex-direction: column;
}

.rating-star {
  display: flex;
  font-size: 12px;
  align-self: flex-end;
}

.header-check-box {
/*   border: 1px solid green; */
  display: flex;
  align-items: center;
}

.checkbox {
/*   border: 1px solid blue; */
  display: flex;
  flex-direction: column;
  
}

.span {
/*   border: 1px solid red; */
  flex-direction: column;
}

.textaera {
  flex-direction: column;
}

input {
/*   border: 3px solid red; */
}

.btn {
  color: inherit;
  background-color: blue;
  border-radius: 5px;
}

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}
              
            
!

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. 

/* 
User Story #1: I can see a title with id="title" in H1 sized text.

User Story #2: I can see a short explanation with id="description" in P sized text.

User Story #3: I can see a form with id="survey-form".

User Story #4: Inside the form element, I am required to enter my name in a field with id="name".

User Story #5: Inside the form element, I am required to enter an email in a field with id="email".

User Story #6: If I enter an email that is not formatted correctly, I will see an HTML5 validation error.

User Story #7: Inside the form, I can enter a number in a field with id="number".

User Story #8: If I enter non-numbers in the number input, I will see an HTML5 validation error.

User Story #9: If I enter numbers outside the range of the number input, which are defined by the min and max attributes, I will see an HTML5 validation error.

User Story #10: For the name, email, and number input fields inside the form I can see corresponding labels that describe the purpose of each field with the following ids: id="name-label", id="email-label", and id="number-label".

User Story #11: For the name, email, and number input fields, I can see placeholder text that gives me a description or instructions for each field.

User Story #12: Inside the form element, I can select an option from a dropdown that has a corresponding id="dropdown".

User Story #13: Inside the form element, I can select a field from one or more groups of radio buttons. Each group should be grouped using the name attribute.

User Story #14: Inside the form element, I can select several fields from a series of checkboxes, each of which must have a value attribute.

User Story #15: Inside the form element, I am presented with a textarea at the end for additional comments.

User Story #16: Inside the form element, I am presented with a button with id="submit" to submit all my inputs.
*/
              
            
!
999px

Console