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

              
                <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <title>Survey</title>    
</head>
<body>
  <h1 id="title" class="text-center"><span>Survey About Our Services</span></h1>
<p id="description" class="text-center">Help us improving our service</p>
<form id="survey-form" action=""> 
  <h3>Tell us about your self :</h3>
  <div id="personal-info">  
  <div>
    <label id="name-label" for="name">*Name:</label>
    <input id="name" type="text" name ="name" 
         placeholder="Enter your name" required>
  </div>
  <div>
    <label id="email-label" for="email">*Email:</label>
    <input id="email" type="email" name="email"
         placeholder="Enter your Email" required>
  </div>
  <div>
    <label for="civility" required>*Civility:</label>
    <select id="civility" name="civility" required>
      <option>Select Your Civility</option> 
      <option value="mr">Mr</option>  
      <option value="mrs">Mrs</option>
      <option value="miss">Miss</option>
      <option value="ms">Ms</option>
    </select>
  </div>
  <div>
    <label id="number-label" for="number" required>Age:</label>
    <input id="number" type="number" name="number"  min="18" max="100"                                      placeholder="Enter your age">
  </div>
  <div id="gender">    
      <label id="gendre-title">Gender:</label>
      <label id="male-label" for="male">
      <input id="male" type="radio" name="gender" value="male">
      <span>&#9794;</span> 
       Male</label>
      <label id="female-label" for="female">
      <input id="female" type="radio" name="gender" value="female"> 
      <span>&#9792;</span> 
        Female</label>     
   </div>
 </div>
 <h3>Tell us about your experience with us:</h3>
 <div id="personal-experience">   
  <label id="dropdown-label" for="dropdown">How many years did you used our services?
  <select id="dropdown" name="dropdown">
    <option >Choose number of years</option>
    <option value="0">0</option>
    <option value="1">1 year</option>
    <option value="2">2 years</option>
    <option value="3">3 years</option>
    <option value="4">4 years</option>
    <option value="5">5 years</option>
  </select>  </label>
  <br>
  
  <p>How likely is that you would recommend our services to a friend?</p>
  <label id="star1-label" for="star1">
  <input id="star1" type="radio" name="stars" value="1">
    <i id="star1-icon" class="material-icons">star_border</i>
    Not recommended</label>
   <label id="star2-label" for="star2">
  <input id="star2" type="radio" name="stars" value="2" required>
    <i id="star2-icon" class="material-icons">star_half</i> 
    Not sure</label>
   <label id="star3-label" for="star3">
  <input id="star3" type="radio" name="stars" value="3">
    <i id="star3-icon" class="material-icons">star</i>
    Highly recommended</label>  
  <br>
  <div id="improve">
  <p>Services that should be improved in the future
  (Check all that apply):</p>
  <label for="service1">
  <input id="service1" type="checkbox" name="service1" value="service1">
    <i id="a" class="material-icons">check_circle</i>
    Customer service</label>
  <label for="service2">
  <input id="service2" type="checkbox" name="service2" value="service2">
    <i class="material-icons">check_circle</i>
    Product quality</label>
  <label for="service3">
  <input id="service3" type="checkbox" name="service3" value="service3">
    <i class="material-icons">check_circle</i>
    Web site</label>
  <label for="service4">
  <input id="service4" type="checkbox" name="service4" value="service4">
    <i class="material-icons">check_circle</i>
    Working time</label>
  <label for="service5">
  <input id="service5" type="checkbox" name="service5" value="service5">
    <i class="material-icons">check_circle</i>
    Offered languages</label>
  <label for="service6">
  <input id="service6" type="checkbox" name="service6" value="service6">
    <i class="material-icons">check_circle</i>
    Offered currencies</label>
  </div>
  </div>
 
  <h3>Any Comments or Suggestions?</h3>   
  <div>
  <textarea id="suggestion" name="sugestion" placeholder="Tell us what's in your mind"></textarea>
  </div>  
  <div>
    <input id="submit" type="submit" value="Submit">
    <p id="req">* required field</p>
  </div>
</form>

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

CSS

              
                *{
  box-sizing: border-box;
}
body{
  background-color: #F4F4F4;
}
.text-center{
  text-align: center;
}
#title{
  margin:0;
  padding:0;
}
#title > span{
  border-bottom: 3px solid red;
}
#description{
  color: #1157D7;
  margin:0.3em 0 2em 0;
  padding:0;
  font-size: 1.1em;
}
#survey-form{
  width:70%;
  margin:auto;
  background-color: #FFFFFF;
  padding: 1em;
  border: 1px solid gray;
  border-radius: 5px;
  box-shadow: 0 5px 15px 2px gray;
}
#survey-form > h3{  
  border-left: 5px solid red;
  padding-left: 4px;
}
#survey-form > div{
  width: 80%;
  margin: auto;  
}
#personal-info{
  display: flex;
  flex-wrap: wrap;    
}

#personal-info > div {   
  width: 50%; 
  padding: 1em;  
}
#personal-info + div > label,
#personal-info > div > input{
  display: block;
  width: 90%; 
}
#personal-info > div > input,
 #dropdown, #civility{
  border: none;
  border-bottom: 1px solid gray ;  
  transition: padding 0.3s ease-in-out, margin 0.3s ease-in-out;
  font-size: 1em;
  padding: 0.5em;
  margin: 0.5em;
}
#personal-info > div > input:focus,
 #dropdown:focus, #civility:focus{
   border-bottom: 1px solid green;  
   padding: 1em;
   margin: 0;
   outline: none;   
}
#gender{
 position: relative;
 user-select: none; 
}
#gender label {
  display: inline;
}
#male, #female{
  position: absolute;  
  opacity: 0;
  cursor: pointer;
}
#male ~span, #female ~span{
  transition: font-size 0.3s linear;
  font-size: 1.4em;
  padding-bottom: 0.1em;
}
#male:checked ~span, #female:checked ~span {  
  color: blue;
  border-bottom: 1px solid green;
} 
#male-label, #female-label{  
  padding: 0.5em;
}
#star1-label{
  position: relative;
}
#star1{
  opacity:0;
}
#star1-icon{
  position: absolute;
  top:0;
  left:0;
  font-size:1.3em;
  color:gray;
}
#star2-label{
  position: relative;
}
#star2{
  opacity:0;
}
#star2-icon{
  position: absolute;
  top:0;
  left:0;
  font-size:1.3em;
  color:gray;
}
#star3-label{
  position: relative;
}
#star3{
  opacity:0;
}
#star3-icon{
  position: absolute;
  top:0;
  left:0;
  font-size:1.3em;
  color:gray;
}
#star1:checked ~ #star1-icon{
  color:red;
}
#star2:checked ~ #star2-icon{
  color:red;
}
#star3:checked ~ #star3-icon{
  color:red;
}
#improve > label{
  position: relative;
  display: block;
  margin-bottom: 0.5em;
  user-select: none;
}
#improve > label input{
  opacity: 0;
}
#improve > label i{
  position: absolute;
  top:0;
  left: 0;
  font-size: 1.5em;
  color: gray; 
}
#improve > label input:checked ~ i {
  color: green;
}
#suggestion{
  width: 100%;
  height: 150px;
  padding: 12px 20px;
  box-sizing: border-box;
  border: 2px solid #ccc;
  border-radius: 4px;
  background-color: #f8f8f8;
  font-size: 16px;
  resize: none;
}
#submit{
  background-color:  #2196F3;
  border: 1px solid  #2196F3;
  border-radius: 5px;
  padding: 0.5em 1em;
  color: white;
  margin-top: 1em;
  opacity: 0.8;
  transition: all 0.3s;
}
#submit:hover{
  opacity: 1;
}
#req{
  float: right;
  color: red;
  opacity: 0.8;
}
@media (max-width:992px){
  #survey-form{
  width:90%;
  }
 #personal-info > div {   
  width: 90%; 
  padding: 1em;  
}
 #gendre-title, #male-label, #female-label{  
   padding:0;
   margin:0; 
}
  #star1-label, #star2-label, #star3-label{
    display: block;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console