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

              
                .card
  .img 
    span
    span
    span
    span
  .content
    h2  MacBook Air
    h2 Lightness
    h4 The most loved Mac is about to make you fall in love all over again. Available in silver, space gray, and gold, the new thinner and lighter MacBook Air features a brilliant Retina display, Touch ID, the latest-generation keyboard, and a Force Touch trackpad
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Poppins')
html,body
  margin: 0
  padding: 0
  width: 100%
  height: 100vh
  background: #141E30
  background: -webkit-linear-gradient(to top, #243B55, #141E30)
  background: linear-gradient(to top, #243B55, #141E30)
  display: flex
  justify-content: center
  align-items: center
  font-family: 'Poppins', sans-serif
  overflow: hidden

.card
  border-radius: 16px
  width: 360px
  height: 360px
  background: url(https://picsum.photos/360/360?image=0)
  position: relative
  overflow: hidden
  box-shadow: 0 5px 50px rgba(#000,.85)
  &:before
    content: ''
    position: absolute
    width: 100%
    height: 100%
    top: 0
    background-color: rgba(#000,.92)
  .img
    position: absolute
    top: 0
    left: 0
    width: 100%
    height: 100%
    display: flex
    span
      width: 25%
      height: 100%
      background: url(https://picsum.photos/360/360?image=0)
      transition: .5s
      &:nth-child(1)
        background-position: 0
        transition-delay: 0
      &:nth-child(2)
        background-position: 33.33333%
        transition-delay: .1s
      &:nth-child(3)
        background-position: 66.66666%
        transition-delay: .2s
      &:nth-child(4)
        background-position: 100%
        transition-delay: .3s
        
.card:hover 
  .img>span
    transform: translateY(-100%)
  .content
    transform: translateY(0%)
    transition: 1s
    transition-delay: .1s
  
.content
  box-sizing: border-box
  display: flex
  justify-content: center
  align-items: center
  flex-direction: column
  color: white
  padding: 20px 20px
  width: 100%
  height: 100%
  transform: translateY(100%)

              
            
!

JS

              
                
              
            
!
999px

Console