cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

  <div class="thumbnail">
    <img src="http://i164.photobucket.com/albums/u25/sheffieldbleep/tDR/303/DSC_0106.jpg" />

  <img src="http://i164.photobucket.com/albums/u25/sheffieldbleep/tDR/303/DSC_0106.jpg" />
  min-width: 1440px;
  margin:20px 60px;
  background: #111 /* url('https://subtlepatterns.com/patterns/dark_stripes.png') */;

section {
  display: inline-block;
  vertical-align: top;
  margin: 0 20px;
  position: relative;
  min-width: 300px;
  min-height: 340px;

p {
  line-height: 9px;
  font-family: sans-serif;
  color: white;
  font-weight: bold;
  text-shadow: 0 1px 6px black;

  to control the size of the thumbnail and the cropping: adjust the clip propery values
.thumbnail { 
  width: 300px; 
  height: 300px; 
  /* overflow: hidden; */
  position: absolute;
  -webkit-transition: all 1s ease;
  -moz-transition: all 1s ease;
  -o-transition: all 1s ease;
  transition: all 1s ease;
  z-index: 1;
  top: 0;
  left: -24px;
  margin-left: -100%;
  margin-top: -40px;
  clip: rect(80px, 624px, 380px, 324px);  

.thumbnail img { 
  width: auto; 
  height: auto; 
  /* margin: -80px -324px; */

.thumbnail:hover {
  clip: rect(80px, 924px, 680px, 324px);
  cursor: pointer;
  z-index: 999;
.thumbnail:active {
  clip: rect(80px, 924px, 680px, 324px);
  cursor: pointer;
  z-index: 999;
inline image cropping demo for css-tricks forum question: 


forked from: https://codepen.io/derekfogge/pen/IlfwD

## Resources:
 * https://css-tricks.com/css-sprites-with-inline-images/ 
 * https://css-tricks.com/almanac/properties/c/clip/
 * https://developer.mozilla.org/en-US/docs/CSS/clip
 * http://www.impressivewebs.com/demo-files/css-clip-gallery/
 * https://jsbin.com/esused/1/edit

Loading ..................