cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation

     

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.

            
              <div class="work-grid">
    <div class="work-grid__row">
        <div class="work-grid__col">
            <div class="work-grid__lg-item item-1">
                <div class="work-grid__item-overlay">
                    <div class="inner">
                        <div class="contents">
                            <h2>Grid Item #1</h2>
                            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam et commodi distinctio assumenda, veniam enim eos sed excepturi odio explicabo!</p>
                            <a href="#" class="btn">View Item</a>
                        </div>                            
                    </div>
                </div>
                <div class="work-grid__item-bg"></div>
            </div>
        </div>
        <div class="work-grid__col">
            <div class="work-grid__sm-item item-2">
                <div class="work-grid__item-overlay">
                    <div class="inner">
                        <div class="contents">
                            <h2>Grid Item #2</h2>
                            <a href="#" class="btn">View Item</a>
                        </div>                            
                    </div>
                </div>
                <div class="work-grid__item-bg"></div>                
            </div>
            <div class="work-grid__sm-item item-3">
                <div class="work-grid__item-overlay">
                    <div class="inner">
                        <div class="contents">
                            <h2>Grid Item #3</h2>
                            <a href="#" class="btn">View Item</a>
                        </div>                            
                    </div>
                </div>
                <div class="work-grid__item-bg"></div>               
            </div>
        </div>
    </div>
    <div class="work-grid__row">
        <div class="work-grid__col">
            <div class="work-grid__sm-item item-4">
                <div class="work-grid__item-overlay">
                    <div class="inner">
                        <div class="contents">
                            <h2>Grid Item #4</h2>
                            <a href="#" class="btn">View Item</a>
                        </div>                            
                    </div>
                </div>
                <div class="work-grid__item-bg"></div>                
            </div>
            <div class="work-grid__sm-item item-5">
                <div class="work-grid__item-overlay">
                    <div class="inner">
                        <div class="contents">
                            <h2>Grid Item #5</h2>
                            <a href="#" class="btn">View Item</a>
                        </div>                            
                    </div>
                </div>
                <div class="work-grid__item-bg"></div>               
            </div>
        </div>
                <div class="work-grid__col">
            <div class="work-grid__lg-item item-6">
                <div class="work-grid__item-overlay">
                    <div class="inner">
                        <div class="contents">
                            <h2>Grid Item #6</h2>
                            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nam et commodi distinctio assumenda, veniam enim eos sed excepturi odio explicabo!</p>
                            <a href="#" class="btn">View Item</a>
                        </div>                            
                    </div>
                </div>
                <div class="work-grid__item-bg"></div>
            </div>
        </div>
    </div>
</div>

            
          
!
            
              @import "bourbon";
@import "neat"; 

@import url(https://fonts.googleapis.com/css?family=Montserrat|Lora);

body {
   color: white;
   font-family: 'Montserrat', sans-serif;
   background-color: #1a1a1a;
}

h1 {
   font-size: 72px;
   letter-spacing: 1px;
   text-align: center;
   cursor: default
}

.work-grid {
    @include outer-container();
}

.work-grid__row {
    @include row();
}

.work-grid__col {
    position: relative;
    height: 500px;
    @include span-columns(6);
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.work-grid__lg-item,
.work-grid__sm-item {
    position: absolute;
    border: 0;
    overflow: hidden;
    
    &:hover {
        opacity: 1;
        transition: opacity 500ms $ease-in-cubic, transform 250ms $ease-in-cubic;
        
        .work-grid__item-overlay {
            opacity: 1;
            transform: scale(1);
            
            .contents {
                opacity: 1;
                transform: scale(1);
            }
        }
        
        .work-grid__item-bg {
            transform: scale(1.1);
        }
    }
}

.work-grid__item-bg {
    position: absolute;
    @include size(100%);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0.75;
    transition: opacity 750ms $ease-out-cubic, transform 500ms $ease-out-cubic;
    z-index: 10;
}

.work-grid__lg-item {
    @include size(100%);
}

.work-grid__sm-item {
    @include size(100% 50%);
    
    &:nth-child(2) {
        bottom: 0;
    }
    
    .work-grid__item-overlay {
        .inner {
             height: 190px;
        }
    }
}

.work-grid__item-overlay {
    position: absolute;
    width: 100%;
    padding: 30px;
    z-index: 20;
    opacity: 0;
    transform: scale(1.2);
    transition: opacity 250ms $ease-out-cubic, transform 250ms $ease-out-cubic;
    
    .inner {
        width: 100%;
        height: 440px;
        background: rgba(0, 0, 0, 0.75);
        padding: 30px;
    }
    
    .contents {
        opacity: 0;
        transform: scale(3);
        transition: opacity 200ms $ease-in-cubic 250ms, transform 300ms $ease-out-cubic 250ms;
    }
    
    h2 {
        color: white;
        font-size: em(32px);        
        text-align: center;
    }
    
    p {
        color: #ccc;
        text-align: center;
    }
    
    .btn {
        width: 100%;
        margin: 0 auto;
        background: none;
    }
}

.item-1 .work-grid__item-bg {
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/194972/24029_1280_1024.jpg');
}

.item-2 .work-grid__item-bg {
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/194972/3910-closeup-of-a-light-orange-cat-pv.jpg');
}

.item-3 .work-grid__item-bg {
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/194972/black-and-white-cat-photographyfree-stock-photos-close-up-of-a-cat-outdoors-in-black-and-white-afzwkt4u.jpg');
}

.item-4 .work-grid__item-bg {
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/194972/mC092u6.jpg');
}

.item-5 .work-grid__item-bg {
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/194972/moRchaQ.jpg');
}

.item-6 .work-grid__item-bg {
    background-image: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/194972/pbVfIau.jpg');
}

            
          
!
999px
Loading ..................

Console