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

              
                <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/css?family=Pacifico|Roboto" rel="stylesheet">
 <link rel="stylesheet" type='text/css' href="main.css">
 <link rel="" href='https://necolas.github.io/normalize.css/8.0.0/normalize.css'>
 <script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
 <title>Survey</title>
</head>

<body>
 <h1 id="title"> Survey Page </h1>
 <p id="description" class='small'> This is a simple survey</p>
 <main>
  <form action="" id="survey-form">
   <div id="txt-div">
    <label for="name" id='name-label'> Name: </label>
    <input type="text" id="name" placeholder="Enter your name" required>
    <label for="email" id='email-label'> Email: </label>
    <input type="email" id="email" placeholder="Enter your email" required>
    <label for="number" id='number-label'> Number: </label>
    <input type="number" id="number" min='1' max='100' placeholder="Enter your number">
   </div>
   <select id='dropdown'>
        <option value="" disabled selected hidden>Please choose your gender</option>
        <option value="dr1">Male</option>
        <option value="dr2">Female</option>
        <option value="dr3">Bot</option>
      </select>

   <div id='rad-ch-container'>
    <div id='rad-container'>
     <div id="rad1-div" class='rad-divs'>
      <label for="rad1"> 1 </label>
      <input type='radio' id='rad1' value='1' name='first'>
     </div>
     <div id="rad2-div" class='rad-divs'>
      <label for="rad2"> 2 </label>
      <input type='radio' id='rad2' value='1' name='first'>
     </div>
     <div id="rad3-div" class='rad-divs'>
      <label for="rad3"> 3 </label>
      <input type='radio' id='rad3' value='1' name='first'>
     </div>
    </div>

    <div id='ch-container'>
     <div id="ch1-div" class="ch-divs">
      <label for="ch1">000</label>
      <input type="checkbox" id='ch1' value="1">
     </div>
     <div id="ch2-div" class="ch-divs">
      <label for="ch2">001</label>
      <input type="checkbox" id='ch2' value="2">
     </div>
     <div id="ch3-div" class="ch-divs">
      <label for="ch3">002</label>
      <input type="checkbox" id='ch3' value="3">
     </div>
    </div>
   </div>

   <textarea rows="2"> </textarea>

   <input type="submit" id='submit'>
  </form>
 </main>
</body>

</html>
              
            
!

CSS

              
                :root {
  --g1: #240041;
  --g2: #27e297;
  --g3: #f62a66;
  --g4: #cdfb00;
  --gray-white: #e9ecef;
  --blue: #007bff;
  --text-black: #2a2c2e;
  --text-gray: #6c757d;
  --green: #17a2b8;
}

* {
  box-sizing: inherit;
  font-family: inherit;
  font-size: inherit;
}

html {
  box-sizing: border-box;
  font-weight: 500;
  font-family: 'Roboto', sans-serif;
  font-size: (12px + 1vmin);
}

body {
  background-color: var(--g1);
  margin: 0;
}

h1 {
  text-align: center;
  color: var(--g2);
  font-family: 'Pacifico', cursive;
  font-size: 1.75em;
}

.small {
  font-size: 1.25em;
  color: var(--gray-white);
  text-align: center;
}

main {
  background-color: var(--g3);
  width: 100%;
  max-width: 600px;
  margin: auto;
  margin-bottom: 7rem;
  border-radius: 15px;
  border-style: solid;
  border-width: 2px;
  border-color: black;
  box-shadow: 7px 7px 2px var(--g4);

  display: flex;
  flex-direction: column;
  align-items: center;
}

form {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding-top: 1em;

  display: flex;
  flex-direction: column;
  align-items: center;
}

#txt-div {
  margin-top: 1rem;
  width: 90%;
  display: grid;
  column-gap: 1.5rem;
  row-gap: 1.5rem;
  grid-template-columns: auto 1fr;
  /* grid-template: auto auto auto; */
  grid-template-areas:
    'label1 input1'
    'label2 input2'
    'label3 input3'
}

#name-label {
  grid-area: label1;
}

#email-label {
  grid-area: label2;
}

#number-label {
  grid-area: label3;
}

#name {
  grid-area: input1;
}

#email {
  grid-area: input2;
}

#number {
  grid-area: input3;
  width: 100%;
}

#txt-div label {
  display: flex;
  justify-content: flex-end;
  align-items: center;
 }
 
 #txt-div input,
 select {
  padding: 0.2em;
 }

 #txt-div input {
  text-align: center;
  border-radius: 5px;
  outline: none;
  border-color: black;
  box-shadow: 4px 7px black;
 }

select {
  width: 80%;
  margin: 2em 0;
  border-radius: 5px;
  outline: none;
  border-color: rgb(4, 4, 92);
  box-shadow: 4px 7px rgb(4, 4, 92);
  text-align: center;
  text-align-last: center;
}
 
#rad-ch-container {
  width: 100%;

  display: flex;
  justify-content: space-around;
}

.rad-divs,
.ch-divs {
  margin-top: 0.5em;
  width: 100%;
  display: flex;
  flex-direction: row-reverse;
  justify-content: center;
  align-items: center;
}

.rad-divs input,
.ch-divs input {
  height: 1em;
  width: 1em;
  margin: 0;
}

.rad-divs label,
.ch-divs label {
  padding-left: 0.75em;
}

textarea {
  margin-top: 1.5em;
  width: 70%;
  border-radius: 5px;
  border-color: black;
}

[type='submit'] {
  margin-top: 2em;
  margin-bottom: 2em;
  padding: 0.5em 1em;
  background-color: var(--blue);
  color: var(--gray-white);
  outline: none;
  border-radius: 5px;
  border-color: transparent;
  box-shadow: 3px 4px 2px 0px var(--g4);
}

@media (max-width: 420px) {
  #txt-div {
    width: 80%;
    row-gap: 0.4rem;
    grid-template-areas: 
      'label1 label1'
      'input1 input1'
      'label2 label2'
      'input2 input2'
      'label3 label3'
      'input3 input3'
  }

  #txt-div label {
    justify-content: center;
  }

  #txt-div input {
    margin-bottom: 1rem;
  }

  select {
    margin-top: 3rem;
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console