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.

              <p>Check the Details for an improved version</p>
<div class="image"></div>
              body {
  background: #333;

.image {
  margin: 20px auto;
  background-color: #fff;
  background-image: url('http://www.alexandery.net/wp-content/uploads/2013/05/IMG_0515.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  width: 400px;
  height: 533px;
  padding: 10px;

p {
  color: #fff;
  font-family: segoe ui, helvetica neue, helvetica, arial, sans-serif;
  font-weight: 200;
              var centerImage = 3,
  	imageUrls = ['http://www.alexandery.net/wp-content/uploads/2013/05/IMG_0518.jpg', 
    preLoad = new Array();

  for(var rowCount = 0; rowCount < imageUrls.length; rowCount++){
   $('.image').append('<div class="imageRow" row-num="' + rowCount + '"></div>'); // Appending row with row-number
   preLoad[rowCount] = new Image();
   preLoad[rowCount].src = imageUrls[rowCount];
  $('.image img').css('display', 'none'); // Hiding Pre-loaded Images
  $('.image .imageRow').css({
    float: 'left',
    height: '100%',
    width: 100 / rowCount + '%',
  $('.image .imageRow').mouseover(function(){
     $('.image').css('background-image', 'url(' + preLoad[$(this).attr('row-num')].src + ')');
     $(this).css('background-image', 'url(' + preLoad[centerImage].src + ')'); // Return to center
Loading ..................