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

              
                <body>
<div class="container">
  <div class="acordion-wrapper">

    <div class="acordion-title">
      <h2 class="title">What is Lorem Ipsum?</h2>
    </div>
    <div class="acordion-count" style="display: none;">
      <div class="text">
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </p>
      </div>
    </div>
    <div class="acordion-title">
      <h2 class="title">Why do we use it?</h2>
    </div>
    <div class="acordion-count" style="display: none;">
      <div class="text">
        <p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).
</p>
      </div>
    </div>
    <div class="acordion-title active">
      <h2 class="title">Where can I get some?</h2>
    </div>
    <div class="acordion-count" style="display: block;">
      <div class="text">
        <p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. </p>
      </div>
    </div>

  </div>

</div>
</body>
              
            
!

CSS

              
                body{ 
  background-color: #f4f8f9;
.container{
   background-color: #f4f8f9;
    display: block;
    position: relative;
    width: 100%;
    padding: 60px 40px 70px 0px;   
    max-width:680px;
   margin: 0 auto;
   
    @media (max-width: 1200px) {
      
      padding: 60px 40px 70px 40px;
    }
    @media (max-width: 1080px) {
      display: block;
      width: 100%;
      margin: 0 auto;
      float: none;
      padding: 45px 20px 45px 20px;
    }
    @media (max-width: 600px) {
      padding: 0 0 0 0 ;
    }

    .title{
      color: #1f2b2d;
      font-family: "SFUI Display";
      font-size: 16px;
      font-weight: 400;
      line-height: 24px;
      text-align: left;
      position: relative;
      vertical-align: middle;
      padding: 13px 0 13px 77px;
      margin: 9px 0 0px 0;

      background-color: #fff;
      @media (max-width: 900px) {
        font-size: 14px;
        line-height: 18px;
      }
      @media (max-width: 600px) {
        font-size: 12px;
        line-height: 16px;
        padding: 9px 0 9px 52px;
      }
    }
    .text{
      opacity: 0.8;
      color: #1f2b2d;
      font-family: "SFUI Display";
      font-size: 14px;
      font-weight: 400;
      line-height: 20px;
      @media (max-width: 900px) {
        font-size: 13px;
        line-height: 18px;
      }
      @media (max-width: 600px) {
        font-size: 12px;
        line-height: 17px;
      }
    }

    .acordion-wrapper {
      margin: 0 auto;
      text-align: center;
      overflow-y: hidden;
      max-width:510px;
      min-width:290px;
    }

    .acordion-title:hover {
      cursor: pointer;

    }

    .acordion-title.active + .acordion-count {
      display: block;
    }


    .acordion-title > .title:before {
      content: '+';
      font-size: 24px;
      font-weight: 100;
      position: absolute;
      left: 0px;
      //line-height: 24px;
      padding: 12px 18px 13px 18px;
      background-color: #77ddf7;
      color: #fff;
      top: 50%;
     // transition: 1s;
      vertical-align: middle;
      transform: translateY(-50%);
      @media (max-width: 600px) {
        font-size: 16px;
        padding: 8px 13px 8px 13px;
      }
    }

    .acordion-title.active > .title {
      text-shadow: none;
    }

    .acordion-title.active > .title:before {
       content: '-';
      padding: 13px 20px 13px 20px;
       //font-size: 39px;
       transition: 0s;
       background-color: #7ace4c;
      @media (max-width: 600px) {
        font-size: 16px;
        padding: 10px 15px 8px 14px;
      }
     }
    .acordion-title.active > .title {
      background-color: #e9eff0;
    }

    .acordion-title > .title:hover {
      &:before{
        background-color: #5cb3c9;
      }
    }
    .acordion-title.active > .title:hover {
      &:before {
        content: '-';
        background-color: #00b006;
      }
    }


    .acordion-count {
      position: relative;
      padding: 15px 25px;
      background-color: #fff;

    }
    .acordion-count, .text > p {
      text-align: left;
      opacity: 0.9;
      color: #1f2b2d;
      font-family: "SFUI Display";
      font-size: 14px;
      font-weight: 400;
      line-height: 20px;
    }
}
}

              
            
!

JS

              
                // acordion
$(document).ready(function () {

  $('.acordion-wrapper').children('.acordion-title').last().addClass('active');

  $(function () {
    var $panel = $('div.acordion-wrapper > div.acordion-count').hide();
    $panel.last().show();

    $('.acordion-wrapper div.acordion-title > .title').on('click', function (event) {
      var $this = $(this);
      $panel.slideUp();
      $this.parent().next().slideDown();
      return false;
    })
  })

});

//active state
$(function () {
  $('.acordion-wrapper div.acordion-title > .title').click(function (e) {

    e.preventDefault();
    var $this = $(this);
    $('.acordion-wrapper').children('.acordion-title').removeClass('active');
    //$this.parent().addClass('active');

    if ($('.acordion-wrapper div.acordion-title').hasClass('active')) {
    } else {
      $this.parent().addClass('active');
    }
  });
});




              
            
!
999px

Console