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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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>
<!-- code for Survey form Title -->
<main>
  <h1 id="title"> Restaurant-Survey Form</h1>

  <!-- Code for Description of Survey Form--->
  <div id="main-form-layout">
    <div id="description-box">
      <p id="description">
        Let us help to know more about our restaurant by your feedback and comments!
      </p>
    </div>

    <!-- Code for Main Survey Form -->
    <form id="survey-form" method="GET" action="">

      <!-- First Name -->
      <div class="row-tab">
        <div class="col-left-side">
          <label id="name-label" for="name">
        *Name:
      </label>
        </div>
        <div class="col-right-side">
          <input type="text" class="input-field" id="name" name="name" autofocus placeholder="Enter Your Name" required>
        </div>
      </div>
      <!-- Email -->
      <div class="row-tab">
        <div class="col-left-side">
          <label id="email-label" for="email">
        * Email:
      </label>
     </div>
     <div class="col-right-side">
       <input type="email" class="input-field"
        id="email" name="email"
        placeholder="Enter Your Email"
        required>
    </div>
  </div>
  <!-- Age -->
  <div class="row-tab">
    <div class="col-left-side">
      <label id="number-label" for="age">
        * Age: 
      </label>
        </div>
        <div class="col-right-side">
          <input type="number" class="input-field" id="number" name="age" min="13" max="125" Placeholder="Age">
        </div>
      </div>
      <!-- Drop Down -->
      <div class="row-tab">
        <div class="col-left-side">
          <label for="favcuisine">
        Which cuisine is your favourite in our restaurant?
      </label>
        </div>
        <div class="col-right-side">
          <select id="dropdown" name="favcuisine">          
        <option disabled value> Select Your           Favourite Cuisine
        </option>
        <option value="indian">Indian                 </option>
        <option value="chinese">Chinese               </option>
        <option value="mexican">Mexican
        </option>
        <option value="thai">Thai
        </option>
        <option value="japanese">Japanese
        </option>
        <option value="italian">Italian
        </option>
        <option value="punjabi">Punjabi
        </option>
        <option value="russian">Russian
        </option>
        <option value="korean">Korean
        </option>
        <option value="other"> Other
        </option>
      </select>
        </div>
      </div>
      <!-- Recommendation -->
      <div class="row-tab">
        <div class="col-left-side">
          <label for="recommend">
          Would you recommend our restaurant to your friends?
        </label>
        </div>
        <!-- radio button option for recommendation-->
        <div class="col-right-side">
          <ul>
            <!-- option 1-->
            <li class="radio">
              <label>
              <input type="radio"                           class="radio" 
              name="radio-buttons"
              value="yes">
               Yes  
            </label>
            </li>
            <!-- option-2 -->
            <li class="radio">
              <label>
              <input type="radio"                           class="radio" 
              name="radio-buttons"
              value="no">
               No  
            </label>
            </li>
            <!-- option-3 -->
            <li class="radio">
              <label>
              <input type="radio"
               class="radio"
               name="radio-buttons"
               value="notsure">
               Not Sure               
            </label>
            </li>
          </ul>
        </div>
      </div>
      <!-- Checkbox for survey ----->
      <div class="row-tab">
        <div class="col-left-side">
          <label for="reference">
              How did you hear about us?
            </label>
        </div>
        <div class="col-right-side">
          <ul>
            <!-- options for checkbox-->
            <li class="checkbox">
              <label>
                <input type="checkbox"
                 name="reference"
                 class="user-review"
                 value="1">
                Friends/Family
              </label>
            </li>
            
            <li class="checkbox">
              <label>
                <input type="checkbox"
                 name="reference"
                 class="user-review"
                 value="2">
                Colleagues
              </label>
            </li>
            
            <li class="checkbox">
              <label>
                <input type="checkbox"
                 name="reference" 
                 class="user-review"
                 value="3">
                Television
              </label>
            </li>
         
            <li class="checkbox">
              <label>
                <input type="checkbox"
                 name="reference" 
                 class="user-review"
                 value="4">
                Search Engine
              </label>
            </li>
            
            <li class="checkbox">
              <label>
                <input type="checkbox"
                 name="reference" 
                 class="user-review"
                 value="5">
                Flyers
              </label>
            </li>
            
            <li class="checkbox">
              <label>
                <input type="checkbox"
                 name="reference" 
                 class="user-review"
                 value="6">
                Others
              </label>
            </li>
            
          </ul>
        </div>
      </div>
      <!-- Comment section --->
      <div class="row-tab comment-box">
        <div class="col-left-side">
          <label for="comments">
           Any Comments or Suggestions?
          </label>
        </div>
        <div class="col-right-side">
          <textarea placeholder="Enter your comments..." id="comments" class="input-field"></textarea>
        </div>
      </div>
      <!-- submit the form -->
      <button id="submit" type="submit">
         Submit                       
      </button>

    </form>
  </div>
</main>
              
            
!

CSS

              
                /* import Google fonts */
@import url("https://fonts.googleapis.com/css?family=Dancing+Script&display=swap");
@import url("https://fonts.googleapis.com/css?family=Handlee|Indie+Flower&display=swap");

/* main survey form css start */

html {
  box-sizing: border-box;
}
body {
  background: url("https://backgroundcheckall.com/wp-content/uploads/2017/12/spices-background-11.jpg")
    no-repeat;
  background-size: cover;
  min-width: 320px;
  font-family: "Dancing Script", cursive;
  text-align: center;
}

/* Restaurant-survey form title css*/
#title {
  font-size: 50px;
  background-color: #000;
  width: 80%;
  max-width: 900px;
  margin: 30px auto;
  color: rgba(255, 255, 51);
  opacity: 0.8;
  border-radius: 7px;
  padding: 5px;
  text-align: center;
}
/* -- main form layout css -- */
#main-form-layout {
  width: 90%;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(47, 9, 9, 0.9);
  border-radius: 5px;
  padding: 10px;
}

#number {
  margin-bottom: 50px;
}

.recommend-box {
  margin-bottom: 50px;
}

/* description css*/
p {
  font-size: 30px;
  color: #fff;
}
/*code for Survey form css */
.row-tab {
  font-family: "Handlee", cursive;
  font-size: 20px;
  color: #f7c331;
  letter-spacing: 0.1rem;
}

.col-left-side {
  display: inline-block;
  text-align: right;
  width: 40%;
  padding: 5px;
  margin-top: 10px;
  vertical-align: top;
}

.col-right-side {
  display: inline-block;
  text-align: left;
  width: 40%;
  vertical-align: middle;
}

.input-field {
  height: 25px;
  width: 300px;
  border: 1px solid #f7c331;
  border-radius: 5px;
  padding: 6px;
  margin: 10px;
  resize: vertical;
}

#dropdown {
  height: 35px;
  width: 312px;
  border: 1px solid #f7c331;
  border-radius: 5px;
  margin: 10px;
  margin-top: 15px;
  padding: 5px;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.radio {
  float: left;
  margin-right: 6px;
  padding-top: 20px;
  margin-left:5px;
}

.checkbox {
  margin-top: 10px;
  padding: 4px 0;
  display: block;
  position: relative;
  margin-left:5px;
}

input[type="checkbox"],
input[type="radio"] {
  transform: scale(1.3);
}

#comments {
  height: 80px;
  resize: vertcal;
  width: 300px;
}

#submit {
  background-color: #f7c331;
  border-radius: 4px;
  color: white;
  font-size: 20px;
  height: 50px;
  width: 100px;
  margin: 10px;
  border: 0px solid;
  cursor: pointer;
}
#submit:hover {
  background-color: orange;
  color: white;
} 

.comment-box {
  margin-top: 50px;
}

/* small laptop screen */
@media screen and (max-width: 850px) {
  .input-field {
    width: 80%;
  }
  select {
    width: 90%;
  }
  #main-form-layout {
    width: 90%;
  }
 
  #dropdown {
    width: 60%;
  }
  #comments {
    width: 80%;
  }
}
/* css for mobile screen */
@media (max-width: 600px) {
  h1 {
    width: 80%;
    font-size: 60px;
    padding: 5px;
    margin: 20px auto;
    text-align: center;
  }
  
  #main-form-layout {
    width: 90%;
  }
  #description-box {
    font-size: 40px;
  }

  .col-left-side {
    width: 90%;
    text-align: left;
    margin: 5px;
    padding: 5px;
  }
  .row-tab {
    font-size: 20px;
  }
  .col-right-side {
    width: 90%;
    float: left;
    margin: 5px;
    padding: 5px;
 }

  .input-field {
    width: 90%;
  }

  #dropdown {
    width: 70%;
  }
  #comments {
    width: 90%;
  }
  select {
    width: 100%;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console