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 http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Survey Form</title>
    <link rel="stylesheet" href="css/survey_form.css" type="text/css" />
</head>
<body>
  <div id="main">
   <header>
      <h1 id="title">Survey Form</h1> 
      <p id="description">Thank you for taking part in the survey</p>
   </header>
   <form id="survey-form">
      
       <label for="name" id="name-label">Enter your name<br />
         <input type="text" id="name" name="name" value="name" placeholder="Enter your name" maxlength="40" required /><br />
       </label>
       <label for="number" id="email-label">Enter you email id<br />
           <input type="email" id="email" name="email-id" value="email-id" placeholder="Enter your email address" required /><br />
       </label> 
       <label for="number" id="number-label">Age:<br />
            <input type="number" id="number" name="age" value="age" min="12" max="30" placeholder="Enter you age" /><br />
       </label>
       <label for="dropdown">What best describes your current role?</label><br />
           <select id="dropdown" name="role" placeholder="...">
            <option value="student">Student</option>
            <option value="full-time-job">Full Time Job</option>  
            <option value="others">Others</option>  
           </select>       
       </label><br />
       <label>Enter your gender</label><br />
       <span id="radio">
       <label>
       <input type="radio" name="gender" value="male" />
       Male</label>
       <label>
       <input type="radio" name="gender" value="female" />
       Female</label><br />
       </span>
       <label>Which company's products do you prefer?</label><br />
       <span id="checkbox">
        <label>
       <input type="checkbox" name="sony" value="sony" />
       Sony</label><br />
       <label>
       <input type="checkbox" name="microsoft" value="microsoft" />
       Microsoft</label><br />
       <label>
       <input type="checkbox" name="corsair" value="corsair" />
       Corsair</label><br />
       <label>
       <input type="checkbox" name="logitech" value="logitech" />
       Logitech</label>
       </span><br />
       <label for="comments">Any comments or suggestions?</label><br />
       <textarea id="comments" rows="10" cols="30" placeholder="Enter comments here.."></textarea><br />
       <input type="submit" id="submit" value="Submit" />
    </form> 
  </div>
</body>
</html>
              
            
!

CSS

              
                body{background-color:rgba(189, 82, 211,0);
      background-image: url(https://www.photoshopsupply.com/wp-content/uploads/2019/05/simple-pattern.jpg)
     
}

#main{
      background-color: rgba(102, 49, 248, 0.6);
      width:60%;
      margin:150px auto 0px auto;
      font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
      font-size: large;
      border:1px solid rgba(102, 49, 248, 0.6);
      border-radius: 35px;
}

#title{text-align: center;
       color:white;
       font-weight:bold;
       font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif ;
       
        

}


#description{text-align: center;
             margin-bottom: 70px;
             color:white;

}

#survey-form{width:100%;
             padding-left:20px;
             margin:0px auto 0px auto;

}


#name, #email, #number{background-color:white;
    margin:20px 40px;
    border:1px solid white;
    border-radius:10px;
    width:80%;
    height:2.5em;
    font-size: large;
    padding-left: 10px;
    
}

label{color:white;
      font-size:22px;
      margin: 0px 40px;

}

select{background-color: white;
       margin:20px 40px;
       border:1px solid white;
       border-radius:7px;
       box-sizing: border-box;
       width:80%;
       height:2.5em;
}

#radio{
       display: flex;
       flex-direction: row;
       justify-content:flex-start;

       margin:20px 0px 20px 0px;
}



#checkbox{display:flex;
          width:80%;
          flex-direction:column;
          justify-content:flex-start;
          margin:20px 0px 20px 0px;
         
          
}

#comments{width:80%;
          height:150px;
        margin:20px 40px;
        border:1px solid white;
        border-radius:7px;
        padding-left: 10px;

}

#submit{background-color: rgb(29, 196, 29);
        width:80%;
        margin:30px 40px;
        border:1px solid rgb(29, 196, 29);
        border-radius:8px;
        height:3em;
        color:white;
        font-size: 22px;
        

}
              
            
!

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