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

              
                <h1 id="title">The Metal Survey</h1>
<div id="main">
  <p id="description">How metal are you?</p>
  <form id="survey-form">
    <div class="line">
      <div class="labels">
       <label id="name-label" for="name" >* Name:</label>
    </div>
    <div class="inputs">
      <input id="name" name="name" type="text" required autofocus class="input-field" placeholder="Enter your name">
  </div>
</div>
    
    <div class="line">
      <div class="labels">      
       <label id="email-label" for="mail">* E-Mail:</label>
      </div>
      <div class="inputs">
        <input id="email" name="mail" class="input-field" type="email" required placeholder="Enter your E-Mail">
      </div>
    </div>
    
    <div class="line">
      <div class="labels">    
        <label id="number-label" for="age">* Age (Must be 16-60):</label>
      </div>
      <div class="inputs">
      <input id="number" name="age" class="input-field" type="number" min="15" max="60" placeholder="Enter your age" required>
      </div>
    </div>
    
    <div class="line">
      <div class="labels">    
      <label id="occupation-label" for="occupation" >* Occupation:</label>
      </div>
      <div class="inputs">      
        <select id="dropdown" name="occupation" class="dropdown" required >
            <option disabled selected value>Select an option</option>
            <option value="Student">Student</option>
            <option value="Full Time Job">Full Time Job</option>
           <option value="Musician">Musician</option>
           <option value="Other">Other</option>
            <option value="notSay">Prefer Not To Say</option>
       </select>
       </div>
    </div>
      
    <div class="line">
       <div class="labels"> 
         <fieldset>
         <label id="listenPeriod-label" >How long have you been a metal fan? </label>
      </div>
     <div class="inputs">
         <label for="all-life">
          <input id="all-life" name="period" type="radio" class="options" value="1">As long as I can remember!
         </label><br>
         <label for="few-years">
          <input id="few-years" name="period" type="radio" class="options" value="2">For a few years.
         </label><br>
         <label for="less-year">
          <input id="less-year" name="period" type="radio" class="options" value="3">Less than a year.
          </label><br>
        </fieldset>
      </div>
     </div>
    
    <div class="line">
      <div class="labels">
        <label id="favorite-genre">* Select your favorite genre</label>
      </div>
      <div class="inputs">
    <select id="dropdown-genres" name="genres" class="dropdown" required>
          <option disabled selected value>Select an option</option>
          <option value="Thrash">Thrash Metal</option>
          <option value="Powermetal">Powermetal</option> 
          <option value="Symphonic-metal">Symphonic Metal</option>
          <option value="Black-metal">Black Metal</option>
          <option value="Death-metal">Death Metal</option>
          <option value="Melodic-death-metal">Melodic Death Metal</option>
          <option value="other">Other</option>
        </select>
      </div>
    </div>
  <div class="line">
    <div class="labels">
      <fieldset>
      <label id="instrument">Check any of the instrument(s) you know how to play</label>
    </div>
    <div class="inputs">
      <label for="guitar">
          <input id="guitar" type="checkbox" name="instruments" value="guitar">Guitar</label><br>
        <label for="bass">
          <input id="bass" type="checkbox" name="instruments" value="bass">Bass</label><br>
        <label for="drums">
          <input id="drums" type="checkbox" name="instruments" value="drums">Drums</label><br>
        <label for="keyboard">
          <input id="keyboard" type="checkbox" name="instruments" value="keyboard">Keyboard</label><br>
        <label for="violin">
          <input id="violin" type="checkbox" name="instruments" value="violin">Violin</label><br>
        <label for="singing">
          <input id="singing" type="checkbox" name="instruments" value="singing">Singing</label><br>
        <label for="other">
          <input id="other" type="checkbox" name="instruments" value="other">Other</label><br>
      </fieldset>
    </div>
  </div>
    <div class="line">
      <div class="labels">
        <fieldset>
        <label id="other-genres">What other kind of music do you like listening to, aside from metal?</label>
      </div>
      <div class="inputs">
        <label for="pop">
          <input id="pop" type="checkbox" name="other-genres" value="pop">Pop</label><br>
        <label for="rap">
        <input id="rap" type="checkbox" name="other-genres" value="rap">Rap/Hip-Hop</label><br>
        <label for="jazz">
          <input id="jazz" type="checkbox" name="other-genres" value="jazz">Jazz</label><br>
        <label for="blues">
          <input id="blues" type="checkbox" name="other-genres" value="blues">Blues</label><br>
        <label for="electronic">
          <input id="electronic" type="checkbox" name="other-genres" value="electro">Electronic Music</label><br>
        <label for="classical">
          <input id="classical" type="checkbox" name="other-genres" value="classical">Classical</label><br>
        <label for="other-music-genre">
          <input id="other-music-genre" type="checkbox" name="other-genres" value="other">Other</label><br>
        </fielset>
      </div>
  </div>
  <div class="line">
    <div class="labels">
      <label id="comments">Enter your comments here</label>
    </div>
    <div class="inputs">
      <textarea id="comment-box" name="comments" placeholder="Type your comment here." style="height:100px;width:400px;resize:vertical;"></textarea>
    </div>
  </div>  
  <button id="submit" type="submit">Submit</button>
</form>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Metal+Mania');

@import url(https://fonts.googleapis.com/css?family=Raleway:400,500);


body{
  text-align:center;
  background-color:black;
  font-family:metal mania, raleway,georgia,serif;
  
}
h1{
  color:red;
  font-size:60px;
}

form{
  font-size:20px;
}
p{
  font-size:40px;
}

#main{
  padding:10px;
  margin:auto;
  background-color:red;
  width:70%;
  background:linear-gradient(0deg,rgba(142, 0, 0, 1),red);
}

.line{
  display:block;
  margin:20px;
  
}

.labels{
  display:inline-block;
  text-align:right;
  width:40%;
  vertical-align:top;
  
}

.inputs{
  display:inline-block;
  text-align:left;
  width:48%;
  margin-left:20px;
}

.input-field{
  position:relative;
  height:25px;
  width:200px;
  border-style:solid;
  border-color:blue;
  background-color:black;
  color:yellow;
  padding:5px;
}
.dropdown{
  height:30px;
  width:150px;
  background-color:black;
  color:yellow;
  border-color:blue;
}
#comment-box{
  background-color:black;
  color:yellow;
  border-style:solid;
  border-color:blue;
  font-size:18px;
  
}

#submit{
 height:50px;
 width:200px;
 background-color:black;
 color:yellow;
 border-style:solid;
 border-color:blue;
  padding:10px;
}
input:invalid{
  border-color:gold;;
}
fieldset{
  border:none;
}

@media screen and (max-width:1200px){
  #comment-box{
    max-width:80%;
  }
}

@media screen and (max-width:800px){
  .labels{
    text-align:center;
    width:80%;
  }
  .inputs{
    width:80%;
  }
  }
  
  
  @media screen and (max-width:500px){
    .labels{
     max-width:100%;
    }
    
    .input-field{
    float:left;
    width:100%;
    
    }
    .dropdown{
      max-width:100%;
    }
    #submit{
      max-width:100%;
    }
    #comment-box{
      max-width:100%;
    }
  }


              
            
!

JS

              
                // coded by @SamAI-Software
const projectName = 'survey-form';
localStorage.setItem('example_project', 'Survey Form');
              
            
!
999px

Console