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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


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


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.


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.


                <button class="button" id="toggle-modal" data-toggle="#thismodal">
    Open modal

<div class="modal" id="thismodal">
    <div class="modal-dialog modal-dialog-closed modal-fill">
        <div class="modal-content">
            <div class="modal-header">
                <span class="modal-title">This is my awesome modal</span>
                <button type="button" class="close" data-dismiss="modal" data-remove="#thismodal">
                    <span aria-hidden="true">&times;</span>
            <div class="modal-body">
                <div class"par">
                  This is my awesome modal; I was inspired by the one in <a href="">Twitter Bootstrap</a>, but written completely from scratch and enhanced to be responsive and nice to look at.
                <p class="par">
                  <b>You have two options:</b> To open it up as a simple modal, small and limited to the top of the screen. However, you can open it up as a full screen modal, the way this one right here is. All you have to do is add the class <span class="code">modal-fill</span> to it.
                <div class="par">
                    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.

Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.

Suspendisse lectus leo, consectetur in tempor sit amet, placerat quis neque. Etiam luctus porttitor lorem, sed suscipit est rutrum non. Curabitur lobortis nisl a enim congue semper. Aenean commodo ultrices imperdiet. Vestibulum ut justo vel sapien venenatis tincidunt. Phasellus eget dolor sit amet ipsum dapibus condimentum vitae quis lectus. Aliquam ut massa in turpis dapibus convallis. Praesent elit lacus, vestibulum at malesuada et, ornare et est. Ut augue nunc, sodales ut euismod non, adipiscing vitae orci. Mauris ut placerat justo. Mauris in ultricies enim. Quisque nec est eleifend nulla ultrices egestas quis ut quam. Donec sollicitudin lectus a mauris pulvinar id aliquam urna cursus. Cras quis ligula sem, vel elementum mi. Phasellus non ullamcorper urna.

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In euismod ultrices facilisis. Vestibulum porta sapien adipiscing augue congue id pretium lectus molestie. Proin quis dictum nisl. Morbi id quam sapien, sed vestibulum sem. Duis elementum rutrum mauris sed convallis. Proin vestibulum magna mi. Aenean tristique hendrerit magna, ac facilisis nulla hendrerit ut. Sed non tortor sodales quam auctor elementum. Donec hendrerit nunc eget elit pharetra pulvinar. Suspendisse id tempus tortor. Aenean luctus, elit commodo laoreet commodo, justo nisi consequat massa, sed vulputate quam urna quis eros. Donec vel. 
            <div class="modal-footer">


                * {
    font-family: "Helvetica", sans-serif;

.modal {
    background-color: rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 0; bottom: 0;
    left: 0; right: 0;
    display: none;
    overflow: hidden;

.modal-dialog {
    position: relative;
    min-height: 300px;
    min-width: 400px;
    max-width: 700px;
    font-size: 14px;
    width: 90%;
    background-color: #fff;
    margin: 40px auto;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, 0.5);
    box-shadow: 15px 0 20px rgba(0, 0, 0, 0.16),
        -15px 0 20px rgba(0, 0, 0, 0.16),
        0 15px 20px rgba(0, 0, 0, 0.16),
        0 -15px 20px rgba(0, 0, 0, 0.16);
    transition: 0.3s;

.modal-dialog-closed {
    margin-top: -110%;

.modal-fill {
    height: calc(100% - 80px);

.modal-content > .modal-header {
    height: 20px;
    padding: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);

.modal-content > .modal-header > button.close {
    float: right;
    -webkit-appearance: none;
       -moz-appearance: none;
        -ms-appearance: none;
            appearance: none;
    padding: 0;
    cursor: pointer;
    background: 0 0;
    border: 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 0 #fff;

.modal-content > .modal-header > button.close:hover {
    color: rgba(0, 0, 0, 0.5);

.modal-content > .modal-header > .modal-title {
    font-size: 18px;

.modal-content > .modal-body {
    position: absolute;
    top: 51px; bottom: 60px;
    display: block;
    box-sizing: border-box;
    padding: 15px;
    min-height: 190px;
    overflow-y: auto;

.modal-content > .modal-footer {
    position: absolute;
    display: block;
    box-sizing: border-box;
    top: auto;
    bottom: 0;
    left: 0; right: 0;
    height: 60px;
    padding: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.2);

.button {
    padding: 10px;
    outline: none;
    border: 2px solid rgba(0, 0, 0, 0.1);
    background-color: #333;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;

.button:hover {
    background-color: #555;

.button:active {
    background-color: #111;

.code {
    background-color: #eaeaea;
    border: 1px solid rgba(0, 0, 0, 0.2);
    padding: 2px 4px;
    border-radius: 4px;
    color: #295753;



                // @author: conmarap

$(document).ready(function() {
    var ev = '[data-dismiss="modal"]';
    function openModal(id) {
        setTimeout(function() {
            var dialog = $(id + " > .modal-dialog");
            if(dialog.length > 0) {
                dialog = $(dialog[0]);
        }, 200);
    function closeModal(item) {
        var _item = $(item).parent().parent().parent().parent();
    function closeThis(item) {
    $(document).on("click", ev, function(e) {
    $(".modal").on("click", function(e) {
        if($("modal")) {
    // Button handler
    $("#toggle-modal").on("click", function(e) {