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

              
                .bookshelf
  .book-grid
    ul
      li 
        img(src="https://images-na.ssl-images-amazon.com/images/I/51uLvJlKpNL._SX321_BO1,204,203,200_.jpg")
      li 
        img(src="https://damonza.com/wp-content/uploads/portfolio/fiction/The-prophecy_03.jpg")
      li 
        img(src="https://i.pinimg.com/564x/f7/c8/12/f7c812c9b0296cd9f119e33a06d9a256.jpg")
  .shelf-shadows
  .shelf
  
.bookshelf
  .book-grid
    ul
      li 
        img(src="https://images.penguinrandomhouse.com/cover/9781101931288")
      li 
        img(src="https://i.harperapps.com/covers/9780062698162/x510.jpg")
      li 
        img(src="https://www.canva.com/learn/wp-content/uploads/2015/03/draculabramstoker-tb-800x0.jpg")
  .shelf-shadows
  .shelf
              
            
!

CSS

              
                .bookshelf
  width: 900px
  margin: 5rem auto
  text-align: center
  position: relative

.book-grid
  z-index: 2
  position: relative
  transform: translateY(-15px)
  // bottom: 0
  // left: 0
  // width: 100%
  
  ul
    list-style: none
    padding: 0
    margin: 0
    display: grid
    grid-template-columns: repeat(3, 1fr)
    
    li
      // You can use either of these to center the images
      
      // margin: auto
      
      // Should be justify-self (x-axis), not align self (y-axis)
      justify-self: center
    
    img
      display: block
      box-shadow: 0px -5px 20px 2px rgba(black, 0.3)
      width: 200px
      height: 300px
      object-fit: cover
      
// .shelving
//   position: relative

// .shelf-shadows
//   height: 1rem
//   box-shadow: 0px -5px 3px 0px rgba(#aaa, 0.2), 0px 15px 20px 0px rgba(#aaa, 0.5), 0px 5px 5px 0px rgba(#777, 0.3)
//   z-index: 1
//   position: absolute
//   top: 0
//   left: 0
//   width: 100%
//   border-radius: 2px

// .bookshelf
//   width: 80vw
//   height: 50vh
//   margin: auto
//   position: relative
  
.shelf-shadows
  position: absolute
  bottom: 0
  left: 0
  width: 100%
  height: 1rem
  border-radius: 2px
  z-index: 1
  box-shadow: 0px -5px 3px 0px rgba(#aaa, 0.2), 0px 15px 20px 0px rgba(#aaa, 0.7), 0px 5px 5px 0px rgba(#777, 0.3)
  
  
// .shelf
//   background:
//     color: #f9f9f9
//   height: 1rem
//   box-shadow: 0px -5px 3px 0px rgba(#aaa, 0.2), 0px 15px 20px 0px rgba(#aaa, 0.5), 0px 5px 5px 0px rgba(#777, 0.3)
//   z-index: 5
//   position: absolute
//   top: 0
//   left: 0
//   width: 100%
//   border-radius: 2px

.shelf
  position: absolute
  bottom: 0
  left: 0
  width: 100%
  height: 1rem
  background:
    color: #f9f9f9
  border-radius: 2px
  z-index: 3
  // box-shadow: 0px -5px 3px 0px rgba(#aaa, 0.2), 0px 15px 20px 0px rgba(#aaa, 0.5), 0px 5px 5px 0px rgba(#777, 0.3)
  
  
              
            
!

JS

              
                
              
            
!
999px

Console