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

              
                .container
  .card(style="--cards:5")
    .child
      h2 Why do I need a will
      p 5 articles
    .child
    .child
    .child
    .child
  .card(style="--cards:3")
    .child
      h2 How to choose who inherits your estate
      p 3 articles
    .child
    .child
  .card(style="--cards:2")
    .child
      h2 What happens when you die
      p 2 articles
    .child
  .card(style="--cards:4")
    .child
      h2 How to choose guardians
      p 4 articles
    .child
    .child
    .child
  .card(style="--cards:4")
    .child
      h2 Why you've been disinherited
      p 4 articles
    .child
    .child
    .child
  .card(style="--cards:3")
    .child
      h2 How to commit fraud, legally
      p 3 articles
    .child
    .child
  .card(style="--cards:5")
    .child
      h2 Stay together for the kids
      p 5 articles
    .child
    .child
    .child
  .card(style="--cards:3")
    .child
      h2 Picking music for your funeral
      p 3 articles
    .child
    .child
              
            
!

CSS

              
                $bg: #F9F9F9
$card: #fff
@import url('https://fonts.googleapis.com/css?family=Arbutus+Slab|Open+Sans&display=swap')

body
  background: $bg
  color: #495456
  margin: 72px
  font-family: Open Sans, sans-serif

h2
  font-family: Arbutus Slab, serif
  font-weight: normal
  color: #000
  line-height: 1.25

p
  position: absolute
  bottom: 0
  font-size: 14px

.container
  max-width: 900px
  display: grid
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr))
  grid-gap: 48px
  margin: 0 auto
 
.card
  cursor: pointer
  position: relative
  height: 0
  padding-bottom: 120%
  --offset-multiplier: 4px
  &:hover
    --offset-multiplier: 6px
  transition: transform 0.6s ease
  --translate: 0
  transform: translate(var(--translate), var(--translate))
  &:hover
    --translate: calc(-1px * (var(--cards) - 1))
    transition: transform 0.3s ease

.child
  position: absolute
  width: 100%
  height: 100%
  padding: 0 16px
  box-sizing: border-box
  background: $card
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1), 0px -4px 8px rgba(255, 255, 255, 0.8)
  border-radius: 6px
  transition: inherit
  --translate: calc(var(--offset) * var(--offset-multiplier))
  transform: translate(var(--translate), var(--translate))
  z-index: 5

  @for $i from 1 through 5
    &:nth-child(#{$i})
      --offset: #{-1+$i}
      z-index: #{5 - $i}
  
              
            
!

JS

              
                
              
            
!
999px

Console