cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

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 class="aw-accordion">
    <h1>Responsive Accordion Content
    <a href="" class="read-article">Read Article</a></h1>
    <div class="one">
        <h1>Sport</h1>
        <span><img src="http://lorempixel.com/150/150/sports">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum blandit augue at libero porta, eu euismod libero cursus. Aliquam id dui nec tortor sodales luctus. Aenean lobortis tortor euismod, malesuada sapien in, euismod ipsum. Maecenas blandit tortor purus, eu mattis libero ullamcorper eget. Phasellus in metus et velit euismod efficitur a non est. Quisque placerat egestas scelerisque. Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh. Nulla vel nunc a ipsum interdum hendrerit. Curabitur arcu lectus, scelerisque sit amet lectus a, cursus pretium nibh. Nunc a arcu efficitur, pharetra dui sed, sodales felis. Duis eget pulvinar libero, at aliquam dui. Donec quis nulla vitae leo volutpat sodales.</span>
    </div>

    <div class="two">
        <h1>People</h1>
        <span><img src="http://lorempixel.com/150/150/people">Lorem ipsum dolor sit amet, consectetur adipiscing elit.Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh.Morbi nec venenatis lectus.Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh.Morbi nec venenatis lectus. Vestibulum blandit augue at libero porta, eu euismod libero cursus. Aliquam id dui nec tortor sodales luctus. Aenean lobortis tortor euismod, malesuada sapien in, euismod ipsum. Maecenas blandit tortor purus, eu mattis libero ullamcorper eget. Phasellus in metus et velit euismod efficitur a non est. Quisque placerat egestas scelerisque. Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh. Nulla vel nunc a ipsum interdum hendrerit. Curabitur arcu lectus, scelerisque sit amet lectus a, cursus pretium nibh. Nunc a arcu efficitur, pharetra dui sed, sodales felis. Duis eget pulvinar libero, at aliquam dui. Donec quis nulla vitae leo volutpat sodales.</span>
    </div>

    <div class="three">
        <h1>Nightlife</h1>
        <span><img src="http://lorempixel.com/150/150/nightlife">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum blandit augue at libero porta, eu euismod libero cursus. Aliquam id dui nec tortor sodales luctus. Aenean lobortis tortor euismod, malesuada sapien in, euismod ipsum. Maecenas blandit tortor purus, eu mattis libero ullamcorper eget. Phasellus in metus et velit euismod efficitur a non est. Quisque placerat egestas scelerisque. Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh. Nulla vel nunc a ipsum interdum hendrerit. Curabitur arcu lectus, scelerisque sit amet lectus a, cursus pretium nibh. Nunc a arcu efficitur, pharetra dui sed, sodales felis. Duis eget pulvinar libero, at aliquam dui. Donec quis nulla vitae leo volutpat sodales.</span>
    </div>
     
    <div class="four"> 
        <h1>Food</h1>
        <span><img src="http://lorempixel.com/150/150/food">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum blandit augue at libero porta, eu euismod libero cursus. Aliquam id dui nec tortor sodales luctus. Aenean lobortis tortor euismod, malesuada sapien in, euismod ipsum. Maecenas blandit tortor purus, eu mattis libero ullamcorper eget. Phasellus in metus et velit euismod efficitur a non est. Quisque placerat egestas scelerisque. Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh.Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh.Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh.Morbi nec venenatis lectus.Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh.Morbi nec venenatis lectus.Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh.Morbi nec venenatis lectus. Vivamus vehicula velit eu venenatis vulputate. In hac habitasse platea dictumst. Duis nibh tellus, commodo vitae dapibus nec, blandit eu nibh.</span>
    </div>
</section>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Open+Sans:300,400&subset=latin,latin-ext);

body{
  background:#34495e;
  font-family:'Open Sans', sans-serif;
}

section.aw-accordion{
  width:800px; 
  margin:40px auto;
  margin-bottom:30px;
}

section.aw-accordion .one, 
section.aw-accordion .two, 
section.aw-accordion .three, 
section.aw-accordion .four{
  font-size:14px;
  width:23%;
  float:left;
  height:230px;
  display:inline-block;
  z-index:1;
  position:relative;
  overflow:hidden;
  padding:1%;
  transition:all 200ms cubic-bezier(0.645, 0.575, 0.090, 1.000);
  cursor: default;
}

section.aw-accordion .one span, 
section.aw-accordion .two span, 
section.aw-accordion .three span, 
section.aw-accordion .four span{
   background: -webkit-linear-gradient(left, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
  height:100%;
  display:table;
}

section.aw-accordion .one{
  background-color:#3498db;
  border-radius:10px 0 0 10px;
}

section.aw-accordion .two{
  background-color:#e74c3c;
}

section.aw-accordion .three{
  background-color:#1abc9c;
}

section.aw-accordion .four{
  background-color:#f1c40f;
  border-radius:0 10px 10px 0;
}

section.aw-accordion .one:hover, 
section.aw-accordion .two:hover, 
section.aw-accordion .three:hover, 
section.aw-accordion .four:hover{
  overflow-y: auto;
}

section.aw-accordion .one:hover span,
section.aw-accordion .two:hover span,
section.aw-accordion .three:hover span,
section.aw-accordion .four:hover span{
   background: -webkit-linear-gradient(left, rgba(255, 255, 255, .7), rgba(255, 255, 255, .7));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

section.aw-accordion div::-webkit-scrollbar {  
    width: 12px;  
}  
section.aw-accordion div::-webkit-scrollbar-track {  
    background-color: rgba(1, 1, 1, .1);
}  
section.aw-accordion div::-webkit-scrollbar-thumb {  
    background-color: rgba(1, 1, 1, .2);
}  
section.aw-accordion div::-webkit-scrollbar-thumb:hover {  
    background-color: rgba(1, 1, 1, .3);
}  

section.aw-accordion div img{
  float:left; 
  margin:0 10px 0 0;
  border:3px solid rgba(255, 255, 255, .2);
  box-shadow:0 0 15px rgba(1, 1, 1, .1);
  -webkit-box-shadow:0 0 15px rgba(1, 1, 1, .1);
  -moz-box-shadow:0 0 15px rgba(1, 1, 1, .1);
  width:150px;
}

section.aw-accordion div img,
section.aw-accordion div h1{
  opacity:.3; 
  transition:all .3s
}

section.aw-accordion div:hover img,
section.aw-accordion div:hover h1{
  opacity:1;
}

section.aw-accordion div h1{
  margin:0 0 5px;
  font-weight:300; 
  color:white;
}

@media (max-width:1024px){
  section.aw-accordion .one,
  section.aw-accordion .two,
  section.aw-accordion .three,
  section.aw-accordion .four{
    font-size:12px;
  }

  section.aw-accordion div img{
    width:80px;
  }

  section.aw-accordion div h1{
    font-size:120%
  }
}

@media (max-width:768px){
  section.aw-accordion div img{
    width:60px;
  }

  section.aw-accordion div h1{
    font-size:100%
  }
}

/* Styling Demo */
section.aw-accordion > h1{
  color:#233445;
  display:block;
  width:100%;
}

section.aw-accordion > h1 > .read-article{
  color:#233445;
  border-radius:5px;
  border:1px solid #233445;
  padding:4px 8px;
  text-decoration:none;
  float:right;
  text-align:center;
  font-size:80%;
}

section.aw-accordion > h1 > .read-article:hover{
  color:white;
  border:1px solid white;
}

@media (max-width:768px){
  section.aw-accordion{
    width:100%; 
  }
  section.aw-accordion h1{
    font-size:80%;
    letter-spacing:-1px;
  }
}
            
          
!
            
              $( "section.aw-accordion div" ).mouseover(function() {
  $(this).css('width','50%');
  $(this).siblings('div').css('width','14%');
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console