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

              
                %h1 GRID HOVER EFFECTS
%p Using Standard transitions and keyframes with a little jQuery.
%div.container.one
  %img(src="https://i.imgur.com/90v1H1C.jpg" alt="Cassette Player")
  %div
    %span
      %h2 SLIDE
      Short description of the image goes here. Can be multi-lines if needed! 
%div.container.one
  %img(src="https://i.imgur.com/COLI4IJ.jpg" alt="Radio")
  %div
    %span
      %h2 SLIDE
      Short description of the image goes here. Can be multi-lines if needed!
%div.container.one
  %img(src="https://i.imgur.com/H5pHOhE.jpg" alt="Laptop")
  %div
    %span
      %h2 SLIDE
      Short description of the image goes here. Can be multi-lines if needed!
<br>
%div.container.two
  %img(src="https://i.imgur.com/H5pHOhE.jpg" alt="Laptop")
  %div
    %span
      %h2 SLIDE
      Short description of the image goes here. Can be multi-lines if needed!
%div.container.two
  %img(src="https://i.imgur.com/90v1H1C.jpg" alt="Cassette Player")
  %div
    %span
      %h2 SLIDE
      Short description of the image goes here. Can be multi-lines if needed!
%div.container.two
  %img(src="https://i.imgur.com/COLI4IJ.jpg" alt="Radio")
  %div
    %span
      %h2 SLIDE
      Short description of the image goes here. Can be multi-lines if needed!
<br>
%div.container.three
  %img(src="https://i.imgur.com/90v1H1C.jpg" alt="Cassette Player")
  %div
    %span
      %h2 FADE
      Short description of the image goes here. Can be multi-lines if needed! 
%div.container.three
  %img(src="https://i.imgur.com/COLI4IJ.jpg" alt="Radio")
  %div
    %span
      %h2 FADE
      Short description of the image goes here. Can be multi-lines if needed!
%div.container.three
  %img(src="https://i.imgur.com/H5pHOhE.jpg" alt="Laptop")
  %div
    %span
      %h2 FADE
      Short description of the image goes here. Can be multi-lines if needed!
<br>
%div.container.four
  %img(src="https://i.imgur.com/H5pHOhE.jpg" alt="Laptop")
  %div
    %span
      %h2 TWIST
      Short description of the image goes here. Can be multi-lines if needed!
%div.container.four
  %img(src="https://i.imgur.com/90v1H1C.jpg" alt="Cassette Player")
  %div
    %span
      %h2 TWIST
      Short description of the image goes here. Can be multi-lines if needed!
%div.container.four
  %img(src="https://i.imgur.com/COLI4IJ.jpg" alt="Radio")
  %div
    %span
      %h2 TWIST
      Short description of the image goes here. Can be multi-lines if needed!
<br>
%div.container.five
  %img(src="https://i.imgur.com/90v1H1C.jpg" alt="Cassette Player")
  %div
    %span
      %h2 FADE
      Short description of the image goes here. Can be multi-lines if needed! 
%div.container.five
  %img(src="https://i.imgur.com/COLI4IJ.jpg" alt="Radio")
  %div
    %span
      %h2 FADE
      Short description of the image goes here. Can be multi-lines if needed!
%div.container.five
  %img(src="https://i.imgur.com/H5pHOhE.jpg" alt="Laptop")
  %div
    %span
      %h2 FADE
      Short description of the image goes here. Can be multi-lines if needed!



              
            
!

CSS

              
                body
  background: #444444 /* Old browsers */
  background: -moz-linear-gradient(-45deg,  #444444 0%, #333333 100%) /* FF3.6+ */
  background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,#444444), color-stop(100%,#333333)) /* Chrome,Safari4+ */
  background: -webkit-linear-gradient(-45deg,  #444444 0%,#333333 100%) /* Chrome10+,Safari5.1+ */
  background: -o-linear-gradient(-45deg,  #444444 0%,#333333 100%) /* Opera 11.10+ */
  background: -ms-linear-gradient(-45deg,  #444444 0%,#333333 100%) /* IE10+ */
  background: linear-gradient(135deg,  #444444 0%,#333333 100%) /* W3C */
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444444', endColorstr='#333333',GradientType=1 ) /* IE6-9 fallback on horizontal gradient */
  text-align: center
  font-family: 'Roboto', sans-serif
.container
  vertical-align: top
  display: inline-block
  position: relative
  background: #efefef
  background-size: cover
  width: 300px
  height: 200px
  overflow: hidden
  margin-right: -0.25em 
  &.one
    div
      &.over
        -webkit-animation: slideLeft 300ms ease-in-out
        -webkit-animation-fill-mode: forwards
      &.out
        -webkit-animation: slideLeftOut 300ms ease-in-out
        -webkit-animation-fill-mode: forwards
  &.two
    div
      &.over
        -webkit-animation: slideUp 300ms ease-in-out
        -webkit-animation-fill-mode: forwards
      &.out
        -webkit-animation: slideUpOut 300ms ease-in-out
        -webkit-animation-fill-mode: forwards
  &.three
    div
      left: 0
      opacity: 0
    &:hover div
      opacity: 1
  &.four
    div
      left: 0
      opacity: 0
      -webkit-transform: rotate(180deg) scale(0.2)
    &:hover div
      opacity: 1
      -webkit-transform: rotate(0deg)
  &.five
    div
      left: 0
      opacity: 0
      -webkit-transform: scale(0.9)
    &:hover div
      opacity: 1
      -webkit-transform: scale(1)
  img
    width: 100%
  div
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3)
    font-weight: 300
    color: #efefef
    text-align: center
    position: absolute
    width: 100%
    height: 100%
    background: rgba(231,76,60,0.7)
    top: 0
    left: 100%
    transition: all 300ms ease-in-out
    background: #a90329 /* Old browsers */
    background: linear-gradient(135deg,  rgba(169,3,41,0.8) 0%,rgba(143,2,34,0.8) 44%,rgba(109,0,25,0.8) 100%) /* W3C */
    &:before
      content: ''
      display: inline-block
      height: 100%
      vertical-align: middle
      margin-right: -0.25em
    span
      display: inline-block
      vertical-align: middle
      padding: 30px
      letter-spacing: 1px
      h2
        font-weight: 900
        font-size: 4em
        letter-spacing: 1px
        line-height: 0.85em
h1
  font-size: 5em
  font-weight: 900
  color: #efefef
  margin: 20px 0 0 0
  letter-spacing: -3px
p
  color: #efefef
  font-weight: 300
  margin-bottom: 20px
  letter-spacing: 7px
        
@-webkit-keyframes slideLeft
  0%
    left: 100%
  70%
    left: 0%
  85%
    left: 4%
  100%
    left: 0%
  
@-webkit-keyframes slideLeftOut
  0%
    left: 0%
  70%
    left: 100%
  85%
    left: 96%
  100%
    left: 100%
  
@-webkit-keyframes slideUp
  0%
    top: 100%
    left: 0%
  70%
    top: 0%
  85%
    top: 4%
  100%
    top: 0%
    left: 0%
  
@-webkit-keyframes slideUpOut
  0%
    top: 0%
    left: 0%
  70%
    top: 100%
  85%
    top: 96%
  100%
    top: 100%
    left: 0%


    
              
            
!

JS

              
                $('.container').hover(
  function(){
    $(this).children("div").removeClass('out').addClass('over');
  },
  function(){
    $(this).children("div").removeClass('over').addClass('out');
  }
);
              
            
!
999px

Console