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

              
                <div class="ac-container">
<input id="ac-1" name="accordion-1" type="checkbox" />
<label for="ac-1">クリックで展開</label>
<div class="ac-small">
<p>この中の文字が展開</p>
</div>
</div>
 
              
            
!

CSS

              
                /* アコーディオン */
.ac-container{
width: auto;
margin: 10px auto;
}
.ac-container label{
width: 180px;
text-align: center;
background: #e07609;
margin: 0 auto 10px;
padding: 15px 5px 0;
position: relative;
display: block;
height: 40px;
cursor: pointer;
color: #fff;
border-radius: 10px;
font-weight: bold;
font-size: 17px;
}
.ac-container label:hover{
background: rgba( 255, 155, 155, 0.55 );
-webkit-transition: all .3s;
transition: all .3s;
}
.ac-container label:after{
color: #fff;
}
.ac-container input:checked ~ label::after {
color: #fff;
}
.ac-container input{
display: none;
}
.ac-container div{
background: rgba(255, 255, 255, 0.5);
margin-top: -1px;
overflow: hidden;
height: 0px;
position: relative;
z-index: 10;
transition: 
height 0.3s ease-in-out, 
box-shadow 0.6s linear;
}
.ac-container input:checked ~ div{
transition: 
height 0.5s ease-in-out, 
box-shadow 0.1s linear;
box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3);
}
.ac-container div p{
color: #777;
line-height: 23px;
font-size: 14px;
padding: 20px;
}
/* 高さの定義 */
.ac-container input:checked ~ div.ac-small{
height: 150px;
}
.ac-container input:checked ~ div.ac-medium{
height: 200px;
}
.ac-container input:checked ~ div.ac-large{
height: 300px;
}
              
            
!

JS

              
                
              
            
!
999px

Console