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

              
                <div class="container">

  <img src="https://www.gannett-cdn.com/presto/2019/04/16/USAT/ce647343-9ea2-45c9-a075-9d0f3deaf8c9-NANCY.jpg" alt="Speaker of the House of Representatives Nancy Pelosi" />

  <div class="book">
    <img src="https://www.gannett-cdn.com/presto/2019/04/16/USAT/ce647343-9ea2-45c9-a075-9d0f3deaf8c9-NANCY.jpg" alt="Speaker of the House of Representatives Nancy Pelosi" />
  </div>

  <img src="https://www.gannett-cdn.com/presto/2019/04/16/USAT/891a1a11-1fc4-470f-8da1-959d7c9a6add-DJ.jpg" alt="Actor Dwayne Johnson" />
  
  <div class="book">
    <img src="https://www.gannett-cdn.com/presto/2019/04/16/USAT/891a1a11-1fc4-470f-8da1-959d7c9a6add-DJ.jpg" alt="Actor Dwayne Johnson" />
  </div>

  <img src="https://www.gannett-cdn.com/presto/2019/04/16/USAT/c36a2abb-b6c3-4b37-b781-bb5bb892d54b-MOHAMED.jpg" alt="Professional soccer player Mohamed Salah" />
  
  <div class="book">
    <img src="https://www.gannett-cdn.com/presto/2019/04/16/USAT/c36a2abb-b6c3-4b37-b781-bb5bb892d54b-MOHAMED.jpg" alt="Professional soccer player Mohamed Salah" />
  </div>
</div>
              
            
!

CSS

              
                // shadows are kind of weird in Safari ¯\_(ツ)_/¯

.book
  width: 18.5em
  height: (@width * 1.2486)
  margin-top: -4.4em
  position: relative
  transform: perspective(60em) rotateX(58deg) rotateZ(-34deg) skewY(-7deg)
  box-shadow: -1.4em 1.7em .3em -.3em alpha(black,.8),
              -1.6em 1.8em .9em -.2em alpha(black,.5),
              .3em 1.9em 1.3em alpha(black,.3)
  border-top-right-radius: .4em
  img
    border-top-right-radius: .4em
    box-sizing: border-box
    width: 100%
    clip: rect(0em,18.5em,23.1em,0em)
    display: block
    position: absolute
    filter: saturate(90%)
  &:before,
  &:after
    content: ''
    position: absolute
    top: 0
  &:before
    width: 105%
    height: 105%                        
    left: -5%
    z-index: -1
    background-repeat: no-repeat
    background-image: linear-gradient(115deg, transparent 2.8%,
                                              #3f3f3f 3%, #3f3f3f 16%,
                                              transparent 16%),
                      linear-gradient(125deg, transparent 10%, #3f3f3f 10%,
                                              #3f3f3f 17%, #222 46.8%,
                                              transparent 47%),
                      linear-gradient(125deg, transparent 46%,
                                              alpha(black,.5) 46.5%,
                                              alpha(black,.25) 49%,
                                              transparent 53%),
                      linear-gradient(to right, #444, #666),
                      linear-gradient(#444, #444),
                      linear-gradient(140deg, transparent 45%,
                                              #eee 45%, #ccc 96.8%,
                                              alpha(#aaa,0) 97%) 
    background-size: 100% 100%,
                     100% 100%,
                     100% 100%,
                     100% .4em,
                     94% .2em,
                     100% 100%
    background-position: 0 0,
                         0 0,
                         0 0,
                         0 95.8%,
                         0 100%,
                         0 0
  &:after
    width: 100%
    height: 100%
    background-repeat: no-repeat
    background-image: linear-gradient(to right, transparent 2%,
                                                alpha(black,.1) 3%,
                                                alpha(black,.1) 4%,
                                                transparent 5%),
                      linear-gradient(-50deg, alpha(black,.1) 20%, transparent 100%),
                      linear-gradient(-50deg, alpha(black,.2) 20%, transparent 100%),
                      linear-gradient(to bottom, alpha(black,.1) 20%, transparent 100%),
                      linear-gradient(to bottom, alpha(black,.1) 20%, transparent 100%)
    background-size: 100% 100%,
                     2% 20%,
                     1% 20%,
                     2% 20%,
                     1% 20%
    background-position: 0 0,
                         2.2% 100%,
                         3% 100%,
                         2.2% 0,
                         3% 0

body
  background-color: darkseagreen
  font-size: 15px
  z-index: 1
  padding: 60px 20px
  
.container
  width: 700px
  display: grid
  grid-template-columns: 1fr 1fr
  align-items: center
  justify-items: center
  gap: 70px 50px
  margin: 0 auto

  > img
    width: 220px
              
            
!

JS

              
                
              
            
!
999px

Console