Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

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.

            
              
  <body>
    <div class="wrapper">
      <div class="card">
        <div class="img-container">
          <img
            src="https://havenly.com/images/fit-in/360x360/filters:quality(50)/https://static.havenly.com/product/production/php_59dbc1d749b6c.jpg"
          />
          <div class="overlay">
            <div class="btn-quick-view icon">
              <i class="fa fa-search"></i> QUICK VIEW
            </div>
          </div>
        </div>
        <p>Crate and Barrel</p>
        <h4 class="title">Paper Twig Branches, Set of 4</h4>
        <h5>$24.95</h5>
        <p class="promotion">Use code SAVEMORE for 20% OFF</p>
        <button><i class="fa fa-shopping-cart"></i> BUY FROM SELLER</button>
      </div>
    </div>
  </body>
</html>

            
          
!
            
              $button-height: 45px
$card-padding: 2em
$card-extra-padding: 1em
$img-dimension: 180px

html,
body
    min-height: 100vh

body
    display: flex
    justify-content: center
    align-items: center
    background-color: #eeeeee
    font-family: 'Lato', sans-serif
    margin: 0

.card
    padding: $card-padding
    position: relative
    box-sizing: content-box
    text-align: center
    width: 14em
    border-radius: 3px
    background-color: white
    justify-items: center
    transition: all 0.2s

    &:hover
        padding-left: calc(#{$card-padding} + #{$card-extra-padding})
        padding-right: calc(#{$card-padding} + #{$card-extra-padding})
        padding-bottom: calc(#{$card-padding} + #{$button-height})
        box-shadow: 0px 0px 8px 0px #b5b5b5

    &:hover button
        transition: .2s
        opacity: 1
        transform: translate(-50%, 0)

    & img
        height: $img-dimension
        width: $img-dimension

p
    font-weight: 300
    font-size: .9em
    line-height: .1em

.promotion
    font-weight: 400
    font-size: .8em
    color: #C4941C

.card h4
    font-size: .9em
    line-height: 1em
    letter-spacing: 0.05em

.card h5
    font-weight: 300
    font-size: 1.1em
    line-height: .5em

button
    transition: all 0.2s
    position: absolute
    bottom: $card-padding
    width: 220px
    height: $button-height
    color: white
    background-color: black
    border: none
    border-radius: 1px
    z-index: 0
    opacity: 0
    left: 50%
    transform: translate(-50%, 200%)
    letter-spacing: .05em

.img-container
    position: relative
    margin-left: 20px
    width: $img-dimension

.overlay
    position: absolute
    top: 0
    bottom: 0
    left: 0
    right: 0
    height: $img-dimension
    width: $img-dimension
    opacity: 0
    transition: .2s ease

.card:hover .overlay
    opacity: .9
    background: rgba(0, 0, 0, 0.5)

.icon
    position: absolute
    width: 40px
    top: 50%
    left: 50%
    width: 60%
    transform: translate(-50%, -50%)

.btn-quick-view
    font-size: .7em
    background-color: darken(gray, 10%)
    border: 1px solid #dbdbdb
    border-radius: 1px
    color: white
    padding: 12px 16px
    cursor: pointer
    transition: .1s ease
    letter-spacing: 0.15em
    font-weight: 300

    &:hover
        background-color: darken(gray, 40%)
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console