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="blue" id="accordion">
    <h3>Enter Title 1</h3>

    <div>
        <img src="http://placehold.it/150x170" style=
        "margin-right: 10px; float: left;">

        <p>Bacon ipsum dolor sit amet jerky capicola shank ball tip venison.
        Prosciutto kielbasa chicken, pork loin shoulder fatback frankfurter
        tenderloin short loin andouille capicola filet mignon. Turducken boudin
        prosciutto pork, ball tip tri-tip pork belly pork loin. Frankfurter
        kielbasa ball tip short ribs pork belly, ham hock chicken meatball
        brisket beef flank jerky. Cow hamburger meatloaf doner short ribs
        turducken ham tenderloin ground round flank jerky jowl corned beef
        spare ribs. T-bone salami kielbasa boudin biltong short loin hamburger
        beef pancetta sirloin tenderloin shank ball tip.</p>
    </div>

    <h3>Enter Title 2</h3>

    <div>
        <p>Bacon ipsum dolor sit amet jerky capicola shank ball tip venison.
        Prosciutto kielbasa chicken, pork loin shoulder fatback frankfurter
        tenderloin short loin andouille capicola filet mignon. Turducken boudin
        prosciutto pork, ball tip tri-tip pork belly pork loin. Frankfurter
        kielbasa ball tip short ribs pork belly, ham hock chicken meatball
        brisket beef flank jerky. Cow hamburger meatloaf doner short ribs
        turducken ham tenderloin ground round flank jerky jowl corned beef
        spare ribs. T-bone salami kielbasa boudin biltong short loin hamburger
        beef pancetta sirloin tenderloin shank ball tip.</p>

        <ul>
            <li>List Item 1</li>

            <li>List Item 2</li>

            <li>List Item 3</li>

            <li>List Item 4</li>
        </ul>
    </div>

    <h3>Enter Title 3</h3>

    <div>
        <p>Bacon ipsum dolor sit amet jerky capicola shank ball tip venison.
        Prosciutto kielbasa chicken, pork loin shoulder fatback frankfurter
        tenderloin short loin andouille capicola filet mignon. Turducken boudin
        prosciutto pork, ball tip tri-tip pork belly pork loin. Frankfurter
        kielbasa ball tip short ribs pork belly, ham hock chicken meatball
        brisket beef flank jerky. Cow hamburger meatloaf doner short ribs
        turducken ham tenderloin ground round flank jerky jowl corned beef
        spare ribs. T-bone salami kielbasa boudin biltong short loin hamburger
        beef pancetta sirloin tenderloin shank ball tip.</p>
    </div>
</div>
              
            
!

CSS

              
                /* Add this to import Font-Awesome */

@import  url(//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css);

/* Add this to important Google Font (Oswald) */
@import  url(https://fonts.googleapis.com/css?family=Oswald:400,300,700);


/* Main accordion css */
#accordion {
    /max-width: 700px; /* You can change this */
    margin: auto; /* You can remove this if you do not need it to align in the center of your element */
    display: block; 
}

/* This controls the text inside the div, you can play with this by adding background-color, border, etc. */
#accordion div {
    padding: 5px 10px;
    display: inline-block;
    overflow: auto;
}

/* This controls the header */
#accordion h3 {
    display: block;
    text-decoration: none;
    outline: none;
    cursor: pointer;
    padding: 8px 11px;
    font-family: Oswald, sans-serif;
    letter-spacing: 1px;
    font-weight: 700;
    margin: 5px;
}

#accordion div p {
  margin-top: 0;
}

/* This CSS controls the Font Awesome Icon, You can float: left as well and add margin-right: 5px; */
.icon-expand,.icon-collapse {
    float: right;
    margin-top: 5px;
}

/* USE THE BELOW CSS FOR BLUE */
.blue h3 {
    background: #377ad0; /* You can change this to whatever background color you want for the header */
    color: #fff; /* You can change this to whatever font color you want for the header */
}
              
            
!

JS

              
                // Make sure you add the jQuery Library and jQuery UI
$(function() {
    $("#accordion").accordion({
        // You can change this to auto or fill for more info view https://api.jqueryui.com/accordion/#option-heightStyle
        heightStyle: "content",
        // Set this to true if you want the active accordion to remain open
        collapsible: true,
        // SSetting active to false will collapse all panels. This requires the collapsible option to be true.
        active: false
    });
    //initialize accordion            
    $("#accordion").accordion();
    //set accordion header options
    $("#accordion").accordion("option", "icons", {
        // You can change this to differnt Font Awesome class  
        'header': 'icon-expand',
        // You can change this to differnt Font Awesome class
        'activeHeader': 'icon-collapse'
    });
});
              
            
!
999px

Console