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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

            
              .view-gallery
  button View Gallery
  
ul
  li.box.box-1
  li.box.box-2
  li.box.box-3
  li.box.box-4
  li.box.box-5
  li.box.box-6
            
          
!

CSS

            
              *
  box-sizing: border-box

ul
  list-style: none
  padding: 0
  perspective: 3000px
  max-width: 768px
  margin: auto
  padding: 2rem
  
@media (min-width: 768px)
  ul
    display: grid
    grid-template-columns: repeat(2, 1fr)
    grid-template-rows: repeat(2, 1fr)
    grid-gap: 1rem
  
.box
  width: 100%
  height: 200px
  margin: -3rem 0 0
  transform: translateY(10vh) skew(60deg, -15deg) rotateX(40deg)
  box-shadow: -5px 5px 30px 1px rgba(black, 0.3)
  transition: all 300ms ease
  
.box-1
  background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/01ZeHnK3F_4_2000px.jpg)
    position: center
    size: cover
    repeat: no-repeat

.box-2
  background: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/0st9yhngses-benjamin-child.jpg)
    position: center
    size: cover
    repeat: no-repeat

.box-3
  background: 
    image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/Great_Wave_off_Kanagawa2_cr.jpg)
    position: center
    size: cover
    repeat: no-repeat

.box-4
  background: 
    image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/bfezchfpm2i-igor-ovsyannykov.jpg)
    position: center
    size: cover
    repeat: no-repeat

.box-5
  background: 
    image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/esawhr5fhn8-oskar-krawczyk.jpg)
    position: center
    size: cover
    repeat: no-repeat

.box-6
  background: 
    image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/495197/joshua-sortino-5581_cr.jpg)
    position: center
    size: cover
    repeat: no-repeat
  
.view-gallery
  text-align: center
  margin: 5vh 0
  
  button
    background: red
    color: white
    padding: 1rem 2rem
    border: 0
    transition: background 200ms ease
    
    &:hover
      cursor: pointer
      background: rgba(red, 0.8)
    
.animated
  transform: translateY(0) skew(0, 0) rotateX(0deg)
  margin: 0 0 1rem
  
@media (min-width: 768px)
  .animated
    margin: 0
            
          
!

JS

            
              $('.view-gallery button').on('click', function() {
  $('.box').toggleClass('animated');
  // $('ul').css({
  //   'max-width' : '100%'
  // });
});
            
          
!
999px

Console