Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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

              
                
<head><link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
</head>

<div class="accordion">
<form>
  <ul>

    <!-- Item 1 -->
    <li class="menu-category">
      <input type="checkbox" id="entrees" name="menu-category"><label for="entrees"><h2>Entrees</h2></label></input>
      <ul>
        <li class="menu-item top">
          <h3>House Salmon</h3>
           <ul>
            <li class="price">$15</li>
            <li class="description">Wild-caught sustainably harvested Coho Salmon, glazed with maple syrup and grilled on an alderwood plank. </li>
          </ul>
        </li>
        <li class="menu-item">
          <h3>BBQ Pulled Pork</h3>
           <ul>
            <li class="price">$16</li>
            <li class="description">Humanely raised, wild foraged Duroc Pork. Whole smoked for 12 hours then pulled.  </li>
          </ul>
        </li>
      </ul>
    </li>

    <!-- Item 2 -->
    <li class="menu-category">
      <input type="checkbox" id="appetizers" name="menu-category"><label for="appetizers"><h2>Appetizers</h2></label></input>
      <ul>
        <li class="menu-item top">
          <h3 class="top">Jalapeño Poppers</h3>
          <ul>
            <li class="price">$8</li>
            <li class="description">Giant jalapeños stuffed with 3 types of cheese. Panko crusted. </li>
          </ul>
        </li>
        <li class="menu-item">
          <h3>Ceviche</h3>
          <ul>
            <li class="price">$11</li>
            <li class="description">Fresh tilefish, marinated to perfection with key limes and our special blend of spices. </li>
          </ul>
        </li>
      </ul>
    </li>
    
    <!-- Item 3 -->
    <li class="menu-category">
     <input type="checkbox" id="desserts" name="menu-category"><label for="desserts"><h2>Desserts</h2></label></input>
      <ul>
        <li class="menu-item top">
          <h3>Tres Leches Cake</h3>
          <ul>
            <li class="price">$8</li>
            <li class="description">This classic dessert is not too sweet and has a custard-like texture.</li>
          </ul>
        </li>
        <li class="menu-item">
         <h3>Mango Sorbet</h3>
          <ul>
            <li class="price">$7</li>
            <li class="description">House-made. We use only ripe organic mangos and natural sweeteners.</li>
          </ul>
      </ul>
      
    </li>
    
    <!-- Item 4 -->
    <li class="menu-category">
      <input type="checkbox" id="salads" name="menu-category"><label for="salads"><h2>Soups & Salads</h2></label></input>
         <ul>
        <li class="menu-item">
          <h3 class="">Blue Cheese and Pear</h3>
          <ul>
            <li class="price">$12</li>
            <li class="description">Roquefort blue cheese crumbled over fresh crisp pear, accompanied by fresh baby arugla and red onions. </li>
          </ul>
        </li>
        <li class="menu-item">
          <h3>Soup of the Day</h3>
          <ul>
            <li class="price">$9</li>
            <li class="description">A rotating soup based on seasonal vegetables. Ask your server for details.</li>
          </ul>
    </li>

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

CSS

              
                
input{
  position:absolute;
  z-index:-1;
}

li{
  font-family:Arial;
  list-style-type: none;
}

h2,h3{
  font-family: 'Roboto', sans-serif;
  color:white;
}

div.accordion {
  width:700px;
  position:relative;
  background-color:#F2F5FF;
  z-index:0;
}

.menu-category h2 {
  background-color:#B7B5E4;
  margin-left:-40px;
  padding-left:40px;
  margin-bottom:-18px;
  padding:7px;
  border-radius:3px;
}

.menu-category h2:hover{
  background-color:#BBC2E2;
}


li.price{
  position:relative;
  top:-38px;
  right:73px;
  font-style:italic;
}

li.description{
  position:relative;
  top:-29px;
  right:40px;
}

li.menu-item {
  top:30px;
  position: absolute; 
  visibility: hidden;
  margin-bottom:-40px;
  padding-bottom:15px;
  margin-left:30px;
  right:40px;
  opacity: 0;
  transition: visibility 0s, opacity 0.5s linear;
  z-index:-1;
}

li.menu-item h3 {
  color:black;
  margin-bottom:18px;
}

li.menu-item:last-of-type{
  margin-bottom:0px;
}


li.menu-item h3,li.menu-item li{
  color:#2E2E30;
}

input:checked ~ ul li.menu-item {
  visibility:visible;
  position:relative;
  visibility: visible;
  opacity: 1;
}

              
            
!

JS

              
                
              
            
!
999px

Console