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>

<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;1,300&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
  <title>Survey form</title>

</head>
<body>

  <div class="container">
  <header class="header">
    <h1 id="title" class="text-center">Gym Survey Form</h1>
    <p id="description" class="description text-center">
      Thank you for taking the time to fill out this form.
    </p>
  </header>

  <form id="survey-form">
    <div class="form-group">
      <label id="name-label" for="name">Name</label>
      <input
        type="text"
        name="name"
        id="name"
        class="form-control"
        placeholder="Enter your name"
        required
      />
    </div>
    <div class="form-group">
      <label id="email-label" for="email">Email</label>
      <input
        type="email"
        name="email"
        id="email"
        class="form-control"
        placeholder="Enter your Email"
        required
      />
    </div>
    <div class="form-group">
      <label id="number-label" for="number"
        >Age</label
      >
      <input
        type="number"
        name="age"
        id="number"
        min="16"
        max="99"
        class="form-control"
        placeholder="Age"
      />
    </div>

    <div class="form-group">
      <h3>How often do you exercise</h3>
      <select id="dropdown" name="role" class="form-control" required>
        <option disabled selected value>Select current role</option>
        <option value="7days">7 Days per weekr</option>
        <option value="5days">5 Days per week</option>
        <option value="3days">3 Days per week</option>
        <option value="none">none</option>
      </select>
    </div>

    <div class="form-group">
      <h3>Would you recommend Gym to a friend?</h3>
      <label>
        <input
          name="user-recommend"
          value="definitely"
          type="radio"
          class="input-radio"
          checked
        />Definitely</label
      >
      <label>
        <input
          name="user-recommend"
          value="maybe"
          type="radio"
          class="input-radio"
        />Maybe</label
      >

      <label
        ><input
          name="user-recommend"
          value="not-sure"
          type="radio"
          class="input-radio"
        />Not sure</label
      >
    </div>

    <div class="form-group">
      <h3>
        What exercises have you practiced?
      </h3>
      <select id="most-like" name="mostLike" class="form-control" required>
        <option disabled selected value>Select an option</option>
        <option value="Soccer">Soccer</option>
        <option value="baseball">Baseball</option>
        <option value="tennis">Tennis</option>
        <option value="other">Other</option>
      </select>
    </div>

    <div class="form-group">
      <h3>
        What benefits do you want?
      </h3>

      <label
        ><input
          name="benefits"
          value="crossfit"
          type="checkbox"
          class="input-checkbox"
        />Crossfit</label
      >
      <label>
        <input
          name="benefits"
          value="calisthenics"
          type="checkbox"
          class="input-checkbox"
        />Calisthenics</label
      >
      <label
        ><input
          name="benefits"
          value="bootcamp"
          type="checkbox"
          class="input-checkbox"
        />Bootcamp</label
      >
      <label
        ><input
          name="benefits"
          value="gym"
          type="checkbox"
          class="input-checkbox"
        />Gym</label
      >
      

    <div class="form-group">
      <h3>Tell us something?</h3>
      <textarea
        id="comments"
        class="input-textarea"
        name="comment"
        placeholder="Drop a line..."
      ></textarea>
    </div>

    <div class="form-group">
      <button type="submit" id="submit" class="submit-button">
        Submit
      </button>
    </div>
  </form>
</div>
  
</body>
</html>




























              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  
}

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

html {
  /* 1 rem // 10px */
  font-size: 62.5%;
}

body {
  font-family:'Roboto', sans-serif;
  font-size: 1.6rem;
  line-height: 1.7;
  font-weight: 400;
  color: rgb(250, 250, 250);
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: -1;
  background-image: linear-gradient(to right bottom , rgba(82, 82, 82, 0.5), rgba(167, 167, 167, 0.5)), url(https://media-exp1.licdn.com/dms/image/C511BAQGoML601ziPig/company-background_10000/0/1571114000790?e=2159024400&v=beta&t=l-DI-u4XNkGgTFqXcGQbG_ozBJlIPqkFvqlN3RNv_YQ);
  background-position: center;
  background-size: cover ;
}

header {
  text-align: center;
}


h1 {
  font-weight: 400;
  font-size: 4rem;
}

p {
  font-size: 300;
  font-size: 2rem;
  font-style: italic;
}

h1,
p {
  margin-top: 0;
  margin-bottom: 0.5rem;
}


label {
  display: flex;
  align-items: center;
  /* font-size: 1.125rem; */
  margin-bottom: 0.5rem;
}

input,
button,
select,
textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button {
  border: none;
}

.container {
  width: 100%;
  margin: 3.125rem auto 0 auto;
}

#survey-form {
  margin: 8rem 30rem;
  padding: 3.5rem 2rem;
  border-radius: 0.25rem;
  background-color: rgba(0, 0, 0, 0.397);
}

.form-group {
  margin: 0 auto 1.25rem auto;
  padding: 0.25rem;
}

.form-control {
  display: block;
  width: 100%;
  height: 4rem;
  padding: 1rem 1.2rem;
  color: #495057;
  background-color: #fff;
  /* background-clip: padding-box; */
  border: 1px solid #ced4da;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: red;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(255, 0, 0, 0.25);
}

.input-radio,
.input-checkbox {
  display: inline-block;
  margin-right: 0.625rem;
  min-height: 1.25rem;
  min-width: 1.25rem;
}

.input-textarea {
  min-height: 120px;
  width: 100%;
  padding: 0.625rem;
  resize: vertical;
}

.submit-button {
  display: inline-block;
  /* width: 100%; */
  margin: 0 35rem 0 35rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.096);
  color: inherit;
  border-radius: 1rem;
  cursor: pointer;
  transition: all .2s;
}

.submit-button:hover {
  transform: scale(1.2);
}

              
            
!

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