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 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

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 class="accordeon">
  <div class="item">
    <input type="radio" name="btn" value="one"/>
    <label for="btn" class="entypo-">Frans Hals</label>
    <article id="content-1"><p><em>Frans Hals the Elder (c. 1582 – 26 August 1666)</em> was a Dutch Golden Age painter born in the Southern Netherlands (present-day Belgium). He is notable for his loose painterly brushwork, and helped introduce this lively style of painting into Dutch art. Hals was also instrumental in the evolution of 17th-century group portraiture.</p></article>
  </div>
  
  <div class="item">
    <input type="radio" name="btn" value="two" checked="checked"/>
    <label for="btn" class="entypo-">Rembrandt van Rijn</label>
    <article id="content-2"><p><em>Rembrandt Harmenszoon van Rijn (15 July 1606 – 4 October 1669)</em> was a Dutch painter and etcher. He is generally considered one of the greatest painters and printmakers in European art and the most important in Dutch history. His contributions to art came in a period of great wealth and cultural achievement that historians call the Dutch Golden Age when Dutch Golden Age painting, although in many ways antithetical to the Baroque style that dominated Europe, was extremely prolific and innovative.</p></article>
  </div>
  
  <div class="item">
    <input type="radio" name="btn" value="three"/>
    <label for="btn" class="entypo-">Johannes Vermeer</label>
    <article id="content-3"><p><em>Johannes, Jan or Johan Vermeer (1632 – December 1675)</em> was a Dutch painter who specialized in domestic interior scenes of middle-class life. Vermeer was a moderately successful provincial genre painter in his lifetime. He seems never to have been particularly wealthy, leaving his wife and children in debt at his death, perhaps because he produced relatively few paintings.</p></article>
  </div>
  
  <div class="item">
    <input type="radio" name="btn" value="four"/>
    <label for="btn" class="entypo-">Jan Steen</label>
    <article id="content-4"><p><em>Jan Havickszoon Steen (c. 1626 – buried 3 February 1679)</em> was a Dutch genre painter of the 17th century (also known as the Dutch Golden Age). Psychological insight, sense of humour and abundance of colour are marks of his trade.</p></article>
  </div>
</div>
              
            
!

CSS

              
                @import url(https://fonts.googleapis.com/css?family=Titillium+Web:300);
*, *:before, *:after {
  margin:0;
  padding:0;
  -webkit-box-sizing:border-box;
  -moz-box-sizing:border-box;
  box-sizing:border-box;
}
.accordeon {
  position:relative;
  top:50px;
  width:90%;
  margin:0 auto;
}
.item {
  position:relative;
  width:100%;
  min-height:40px;
  margin:2px 0;
}
input[type="radio"], input[type="radio"] + label {
  position:absolute;
  width:100%;
  height:40px;
}
input[type="radio"] {
  opacity:0;
  z-index:9;
  cursor:pointer;
}
input[type="radio"] + label {
  background:url('https://dl.dropboxusercontent.com/u/330966/static/accordeonDown.svg') #f5f3f2;
  background-repeat:no-repeat;
  background-position:100% 0%;
  padding:2px 15px 0 15px;
  font-size:1.4rem;
  color:#333;
  z-index:8;
}
article[id^="content-"] { /* more or individual styling can be applied by using id$="number" */
  position:relative;
  width:100%;
  padding:0px 15px 0px 15px;
  height:auto;
  max-height:0px;
  background:white;
  overflow:hidden;
  -webkit-transition:all .25s;
  -moz-transition:all .25s;
  -o-transition:all .25s;
  transition:all .25s;
}
article[id^="content-"]:before {
  content:'';
  position:absolute;
  top:45px;
  left:15px;
  width:0;
  height:1px;
  background:tomato;
  -webkit-transition:width 0s;
  -moz-transition:width 0s;
  -o-transition:width 0s;
  transition:width 0s;
}
input[type="radio"]:hover + label {
  background:url('https://dl.dropboxusercontent.com/u/330966/static/accordeonDown.svg') #fff;
  background-repeat:no-repeat;
  background-position:100% 0%;
}
input[type="radio"]:checked + label {background:white;}
input[type="radio"]:checked ~ article[id^="content-"] {
  height:auto;
  max-height:600px;
  padding:55px 15px 15px 15px;
  -webkit-transition:all .25s .25s;
  -moz-transition:all .25s .25s;
  -o-transition:all .25s .25s;
  transition:all .25s .25s;
}
input[type="radio"]:checked ~ article[id^="content-"]:before {
  width:40px;
  -webkit-transition:width .3s .3s;
  -moz-transition:width .3s .3s;
  -o-transition:width .3s .3s;
  transition:width .3s .3s;
}
em {
  font-weight:300;
  font-style:normal;
  color:tomato;
}
body {
  background:#d6d2d1;
  font-family: 'Titillium Web', sans-serif;
  font-weight:300;
  color:#333;
  -webkit-transform:translate3d(0, 0, 0);
  -moz-transform:   translate3d(0, 0, 0);
  -ms-transform:    translate3d(0, 0, 0);
  -o-transform:     translate3d(0, 0, 0);
  transform:        translate3d(0, 0, 0);
}
html, body {
  width:100%;
  height:100%;
}
              
            
!

JS

              
                
              
            
!
999px

Console