cssAudio - ActiveCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmloctocatspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

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.

            
              
<section>
    <h1>Questions</h1>
    <span class="sub-header">Click a question below to expand and view the answers.</span>

    <div  id="accordion">
        <a href="#" class="question">1. WHY SHOULD I USE <span class="arrow-icon"></span></a>
        <div class="answer">orem ipsum dolor sit amet, consectetur adipisicing elit.
            Ab ad consequuntur delectus, ea eum explicabo facere
        </div>
        <a href="#" class="question">2. DOES  WORK ON ALL COMPUTERS AND PHONES?<span class="arrow-icon"></span></a>
        <div class="answer">Lorem ipsum dolor sit amet, consectetur adipisicing elit.
            Ab ad consequuntur delectus, ea eum explicabo facere impedit maxime molestias
            mollitia natus neque nesciunt nihil quam quas, quo, quod vitae voluptatum.
        </div>
        <a href="#" class="question">3. HOW CAN I USE WITH OTHER THINGS?<span class="arrow-icon"></span></a>
        <div class="answer">Lorem ipsum dolor sit amet, consectetur adipisicing elit.
        A amet asperiores, aspernatur at commodi consequuntur,
        cum eius eligendi facilis illo ipsam magnam non odio perspiciatis repellat repellendus
        rerum, sapiente soluta.
        </div>
        <a href="#" class="question">4. HOW MANY SALES ?<span class="arrow-icon"></span></a>
        <div class="answer">Lorem ipsum dolor sit amet, consectetur adipisicing elit.
            At expedita repudiandae sint tempore vitae! Cupiditate
            debitis dolor est eum, hic id neque nisi odit provident quae qui quod repellat ut.
        </div>
        <a href="#" class="question">5. HOW MUCH  IT COST?<span class="arrow-icon"></span></a>
        <div class="answer">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias, vero, voluptas! Animi aspernatur culpa cumque
            delectus deserunt distinctio dolor doloribus ea eaque excepturi facere,
            harum illo odio officiis sunt voluptatibus.
        </div>
    </div>
</section>

            
          
!
            
              @import "compass/css3";

@import url(http://fonts.googleapis.com/css?family=Droid+Sans:400,700);

* {
  margin: 0;
  padding: 0;
}
section {
  font-family: 'Droid Sans', sans-serif;
  margin: 50px auto;
  width: 1000px;

  h1 {
    color: #111;
    font-size: 40px;
    text-transform: uppercase;
  }
  .sub-header {
    color: #666;
    font-size: 21px;
    line-height: 45px;

  }
}

#accordion {
  background-color: #eee;
  border: 1px solid #e7e7e7;
  color: #666;
  margin-top: 50px;

  .question {
    border-bottom: 1px solid #e7e7e7;
    color: #666;
    display: block;
    font-size: 21px;
    font-weight: bold;
    line-height: 90px;
    padding-left: 48px;
    text-transform: uppercase;
    text-decoration: none;

    &:last-child {
      border-bottom: none;
    }

    span {
      background: url("http://i1367.photobucket.com/albums/r799/Yaroslav_Kuzyo/Works/arrows_zps261ec063.png") no-repeat 0 -33px;
      float: right;
      height: 27px;
      margin: 30px 20px 0 0;
      width: 27px;
    }
  }

  .answer {
    background-color: #eee;
    border-bottom: 1px solid #e7e7e7;
    display: none;
    font-size: 18px;
    padding:0 75px 35px 75px;
    margin-top: -25px;

    &:last-child {
      border-bottom: none;}

  }

}
            
          
!
            
              
$(document).ready( function() {

    $('#accordion').on('click','.question', function() {
      $(this).next().slideToggle(200);
    });

});


            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console