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

              
                <div id="main" class="flex-container"> 

<h1 id="title">Cookie Survey</h1>
  
  <p id=description>This is a survey to see what type of cookie is most popular with people: Chocolate Chip, Chocolate, or Peanut Butter.</p>
  
  
    
  <!-- Dropdown menu test begins -->
    
<div class="dropdown">
  <button class="dropbtn">Dropdown</button>
  <ul class="dropdown-content">
    
    <li><a href="#name">Name</a></li>
    
    <li><a href="#email">E-Mail</a></li>
    
    <li><a href="#number">Number</a></li>
    
  </ul>
    </div>
    <!-- Dropdown menu test ends -->
  
  <div id=form><form id="survey-form" Survey-Holder>
  
    <div id=survey><br><label id="name-label" for="name"> Name: </label>
    <input id="name" type="text" name="name" placeholder="Enter your name" required></br>
    
    <br><label id="email-label" for="email"> E-mail: </label>
    <input id="email" type="email" name="email" placeholder="Enter your email" required></br>
  
  <br><label id="number-label" for="number"> Number of cookies you eat per batch: </label>
  <input id="number" type="number" name="number" min="1" max="50" placeholder="Here" required></br>

  <p id="option-label">Do you drink milk with cookies?</p>
  <select id="dropdown">
    
    <option id="option1">Yes</option>
    
    <option id="option2">No</option>
    
  </select>

<ul>
  <p id="gender-label">What is your gender?</p>
  <li class="radio-buttons"><label><input type="radio" value="1" name="gender">Male</label></li>
  <li class="radio-buttons"><label><input type="radio" value="2" name="gender">Female</label></li>
  <li class="radio-buttons"><label><input type="radio" value="3" name="gender">Other/Prefer Not to Answer</label></li>
  </ul>
  
  <ul>
  <p>Which cookies do you prefer?</p>
  
  <li class="checkbox"><label><input type="checkbox" name="Checkbox" value="1">Chocolate Chip</label></li>
  <li class="checkbox"><label><input type="checkbox" name="Checkbox" value="2">Chocolate</label></li>
  <li class="checkbox"><label><input type="checkbox" name="Checkbox" value="3">Peanut Butter</label></li>
  
  </ul>
  
  <div><textarea id="textarea" Placeholder="Questions? Thoughts?"></textarea></div>

<button id="submit" type="submit">Submit</button>

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

CSS

              
                body {
  background-color: grey;
  background-image: url(http://www.fullhdwpp.com/wp-content/uploads/Chocolate_Chip_Cookies.jpg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

#title {
  color: black;
  position: relative;
}

#description {
  display: block;
  color: black;
  font-size: 20px;
  background-color: white;
  box-sizing: border-box;
  width: 300px;
  height: 130px;
  padding: 20px;
  border-radius: 25px;
  text-align: justify;
}

@media (max-width: 1000px) {
  #description{
    margin: 0 auto;
  }
}

div {
  <!-- border: solid 1px red;
  margin: 2px; -->
}

.dropdown {
  position: relative;
  display: inline-block;
   margin-left: 45%;
  margin-bottom: 0px;
  border-radius: 25px;
}

.dropbtn {
  background-color: #CAF50;
  padding: 16px;
  font-size: 16px;
  border-radius: 25px;
}

.dropdown-content {
  display: none;
  position: absolute;
  list-style: none;
  background-color: #f1f1f1;
  margin:0;
  padding:0;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {background-color: #ddd;}

.dropdown:hover .dropdown-content {display: block;}

.dropdown:hover .dropbtn {background-color: #3e8e41}

#form {
  align-items: center;
  display: flex;
  height: auto;
  flex-direction: column;
  align-items: center;
  padding: 50px;
  background-color: #999966;
  border-radius: 25px;
  width: 1000px;
  margin: 0 auto;
  position: relative;
}

@media (max-width: 1000px) {
  #form {
    width: auto;
    align-items: left;
  }
}

#name-label {
  margin: 7.5px;
  display: block;
}

#email-label {
  margin: 7.5px;
  display: block;
}

#number-label {
  margin-left: 7.5px;
  margin-bottom: 10px;
  display: block;
}

#dropdown {
  margin-left: 67px;
}

#option-label {
  margin: 10px;
  display: block;
}

#dropdown {
  margin: 0px;
}

.radio-buttons {
  margin: 10px;
}

.checkbox {
  margin: 10px;
}

#textarea {
  margin-left: 40px;
}

#submit {
 margin-left: 95px;
}

#survey {
  background-color: #999966;
}
              
            
!

JS

              
                const dropdown = document.querySelector(".dropdown");
const dropdownContent = document.querySelector(".dropdown-content");

dropdown.addEventListener('click',function(){
  dropdownContent.classList.toggle("active"); //toggle class that shows menu
});

              
            
!
999px

Console