Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs 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 its URL and the proper URL extension.

+ 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

Auto Save

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="grid-system">
    <div class="grid-item" style="background-image: url(http://img1.cfstatic.com/wallpapers/41c451b90b838fbd05038b67e2c472a0_large.jpeg)">
        <a class="link" href="#">
            <span class="titleLabel">Item #1</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-1" type="checkbox">
            <label for="fav-item-1">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-1" type="checkbox">

            <label for="share-item-1">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
    <div class="grid-item" style="background-image: url(http://www.cotedor-tourisme.com/sites/default/files/IMG06145_recadree_palais_de.jpg)">
        <a class="link" href="#">
            <span class="titleLabel">Item #2</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-2" type="checkbox">
            <label for="fav-item-2">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-2" type="checkbox">

            <label for="share-item-2">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
    <div class="grid-item" style="background-image: url(http://www.avocats-duparc.fr/sites/default/files/dijon_france.jpg)">
        <a class="link" href="#">
            <span class="titleLabel">Item #3</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-3" type="checkbox">
            <label for="fav-item-3">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-3" type="checkbox">

            <label for="share-item-3">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
    <div class="grid-item" style="background-image: url(http://www.bsbu.eu/cmsms/uploads/images/Place%20Libe.jpg)">
        <a class="link" href="#">
            <span class="titleLabel">Item #4</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-4" type="checkbox">
            <label for="fav-item-4">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-4" type="checkbox">

            <label for="share-item-4">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
    <div class="grid-item" style="background-image: url(https://d2loyjj9j7ib79.cloudfront.net/production/panoramas/22/medium/dijon.jpg?1316592120)">
        <a class="link" href="#">
            <span class="titleLabel">Item #5</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-5" type="checkbox">
            <label for="fav-item-5">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-5" type="checkbox">

            <label for="share-item-5">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
    <div class="grid-item" style="background-image: url(http://upload.wikimedia.org/wikipedia/commons/thumb/1/10/Palais_des_ducs_de_Bourgogne_Dijon.jpg/476px-Palais_des_ducs_de_Bourgogne_Dijon.jpg)">
        <a class="link" href="#">
            <span class="titleLabel">Item #6</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-6" type="checkbox">
            <label for="fav-item-6">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-6" type="checkbox">

            <label for="share-item-6">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
    <div class="grid-item" style="background-image: url(http://upload.wikimedia.org/wikipedia/commons/3/36/Rue_de_Dijon.JPG)">
        <a class="link" href="#">
            <span class="titleLabel">Item #7</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-7" type="checkbox">
            <label for="fav-item-7">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-7" type="checkbox">

            <label for="share-item-7">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
    <div class="grid-item" style="background-image: url(http://www.vemb-location.fr/assets/images/Dijon-photo-11.jpg)">
        <a class="link" href="#">
            <span class="titleLabel">Item #8</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-8" type="checkbox">
            <label for="fav-item-8">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-8" type="checkbox">

            <label for="share-item-8">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
    <div class="grid-item" style="background-image: url(http://www.scamprecouvrement.com/cache/images/content/ville-dijon-156.jpg)">
        <a class="link" href="#">
            <span class="titleLabel">Item #9</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-9" type="checkbox">
            <label for="fav-item-9">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-9" type="checkbox">

            <label for="share-item-9">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
    <div class="grid-item" style="background-image: url(http://www.permis-dexploitation.com/wp-content/uploads/2013/11/dijon.jpg)">
        <a class="link" href="#">
            <span class="titleLabel">Item #10</span>
            <span class="hoverLabel">Go to the item</span>
        </a>

        <div class="favorite">
            <input id="fav-item-10" type="checkbox">
            <label for="fav-item-10">
                <i class="fa fa-star icon"></i>
            </label>
        </div>

        <div class="share">
            <input id="share-item-10" type="checkbox">

            <label for="share-item-10">
                <i class="fa fa-share-alt icon"></i>
            </label>

            <div class="shareModal">
                Share this item !

                <p>
                    <a href="#"><i class="fa fa-facebook"></i></a>
                    <a href="#"><i class="fa fa-twitter"></i></a>
                </p>
            </div>
        </div>
    </div>
</div>
              
            
!

CSS

              
                @import "bourbon";

$_transitionTiming: 200ms;
$_transitionFunction: ease;

$blue: #518fcd;
$red: #fb887c;
$white: white;

* {
    box-sizing: border-box;
}

.grid-system {
    margin: 10px;
    @include display (flex);
    @include flex-wrap (wrap);

    .grid-item {
        @include flex (1 0 300px);
        width: auto;
        margin: 10px;
    }
}

.grid-item {
    background-size: cover;
    background-position: center;
    height: 300px;
    width: 400px;
    position: relative;

    .link {
        display: block;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        background-color: transparent;
        z-index: 7;
        overflow: hidden;
        box-shadow: 0;
        @include transition (all $_transitionTiming $_transitionFunction);

        &:hover, &.-hover,
        &:focus, &.-focus {
            box-shadow: 0 0 0 5px $blue;
            background-color: transparentize($blue, 0.3);

            .hoverLabel {
                @include transform (translateX(-50%) translateY(-50%) rotate(0));
                margin-top: 0;
                margin-left: 0;
                opacity: 1;
            }

            .titleLabel {
                @include transform (translateX(-100%));
            }
        }
    }

    .hoverLabel {
        display: inline-block;
        position: absolute;
        left: 50%;
        top: 50%;
        @include transform (translateX(-50%) translateY(-50%) rotate(-90deg));
        font-size: 20px;
        line-height: 20px;
        border-top: 2px solid $white;
        border-bottom: 2px solid $white;
        padding: 10px;
        color: $white;
        opacity: 0;
        @include transition (all $_transitionTiming $_transitionFunction);
    }

    .titleLabel {
        display: inline-block;
        color: $white;
        background-color: $red;
        text-transform: uppercase;
        font-size: 30px;
        padding: 10px 20px;
        font-weight: bold;
        bottom: 100px;
        position: absolute;
        color: rgba(0,0,0,.4);
        @include transform (translateX(0%));
        @include transition (all $_transitionTiming $_transitionFunction);
    }

    .favorite {
        input {
            visibility: hidden;

            + label {
                position: absolute;
                top: -5px;
                right: -5px;
                z-index: 8;
                width: 70px;
                height: 70px;
                cursor: pointer;

                .icon {
                  line-height: 47px;
                  margin-right: 19px;
                  float: right;
                  color: $red;
                  @include transition (all $_transitionTiming $_transitionFunction);
                }

                &:before {
                    content: '';
                    border-bottom: 45px solid $white;
                    border-left: 45px solid transparent;
                    border-right: 45px solid transparent;
                    top: -2px;
                    right: -25px;
                    position: absolute;
                    @include transform (rotate(45deg));
                    @include transition (all $_transitionTiming $_transitionFunction);
                }

                &:hover {
                    .icon {
                        line-height: 47px;
                        margin-right: 19px;
                        color: $white;
                    }

                    &:before {
                        border-bottom: 45px solid transparentize($red, 0.5);
                        border-left: 45px solid transparent;
                        border-right: 45px solid transparent;
                        top: -2px;
                        right: -24px;
                    }
                }
            }

            &:checked,
            &.-checked {
                + label {
                    position: absolute;
                    top: -5px;
                    right: -5px;
                    z-index: 10;
                    width: 70px;
                    height: 70px;
                    cursor: pointer;

                    &:hover {
                        &:before {
                            border-bottom: 50px solid transparentize($red, 0.5);
                        }
                    }

                    .icon {
                        line-height: 40px;
                        float: right;
                        margin-right: 17px;
                        color: $white;
                        @include transition (all $_transitionTiming $_transitionFunction);
                    }

                    &:before {
                        content: '';
                        border-bottom: 50px solid $red;
                        border-left: 50px solid transparent;
                        border-right: 50px solid transparent;
                        position: absolute;
                        top: -7px;
                        right: -32px;
                        @include transform (rotate(45deg));
                        @include transition (all $_transitionTiming $_transitionFunction);
                    }
                }
            }
        }
    }

    .share {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      overflow: hidden;

        input {
            visibility: hidden;

            + label {
                position: absolute;
                bottom: -5px;
                left: -5px;
                z-index: 10;
                width: 70px;
                height: 70px;
                cursor: pointer;
                margin-bottom: 0;

                .icon {
                  line-height: 82px;
                  margin-left: 14px;
                  float: left;
                  color: $blue;
                  @include transition (all $_transitionTiming $_transitionFunction);
                }

                &:before {
                    content: '';
                    border-top: 45px solid $white;
                    border-left: 45px solid transparent;
                    border-right: 45px solid transparent;
                    bottom: -2px;
                    left: -25px;
                    position: absolute;
                    @include transform (rotate(45deg));
                    @include transition (all $_transitionTiming $_transitionFunction);
                }

                &:hover {
                    .icon {
                        color: $white,
                    }

                    &:before {
                        border-top: 45px solid $blue;
                    }
                }
            }

            ~ .shareModal {
                position: absolute;
                top: -113%;
                left: 0;
                right: 0;
                bottom: 113%;
                z-index: 9;
                background-color: white;
                @include transition (all 0.7s $_transitionFunction);
                padding: 90px 10px 10px;
                font-size: 20px;
                text-align: center;
                font-weight: bold;

                p {
                    margin-top: 40px;

                    * + * {
                        margin-left: 20px;
                    }

                    a {
                        color: $blue;
                    }
                }

                &:before {
                  content: '';
                  display: block;
                  width: 174%;
                  height: 39px;
                  background-color: white;
                  position: absolute;
                  bottom: -29px;
                  left: 0;
                  z-index: 8;
                  transform: rotate(5deg);
                }
            }

            &:checked {
                + label {
                    .icon {
                        color: $white,
                    }

                    &:before {
                        border-top: 45px solid $blue;
                    }

                    &:hover {
                        .icon {
                            color: $blue,
                        }

                        &:before {
                            border-top: 45px solid $white;
                        }
                    }
                }

                ~ .shareModal {
                    top: 0;
                    bottom: 0;
                }
            }
        }
    }
}
              
            
!

JS

              
                //no javascripts !
              
            
!
999px

Console