I’ve talked about animating filterspreviously, but they are not always the most appropriate way to create image transitions. For some effects – such as replicating the development process of a Polaroid photograph – you might need to think a little out of the box.

Whatever we are about to do to this image, we don’t want it affecting the outside edge of the picture, which would happen if we simply added a border. Instead we’ll create a frame with a div:

(Alternatively, you could place the image as a background for a div with a set height and width.)

We’ll float the outside div to bring it against the edges of the interior element, creating the frame at the same time:

div#polaroid {

float: left; border: 25px solid #f3f4e3;

border-bottom-width: 50px;

background: #1d1904;

}

div#polaroid img { width: 400px; height: 364px; }

We want the Polaroid to visibly develop from the center out towards the edge. To do that, we’ll reset the styles above and apply an inset box-shadow with no offset and a large spread value to the div. I have also added a slight sepia filter to make give the picture a little more of a Polaroid feel. (In the CSS, we’ll keep to the W3C standard property for transitions; you will need to add vendor prefixes for broader support in other browsers ).

div#polaroid {

float: left; border: 25px solid #f3f4e3;

border-bottom-width: 50px; transition: 3s all ease-in;

box-shadow: 0 0 200px 200px rgba(29,25,4,1) inset;

}

We won’t be able to see this shadow due to the fact that the image is "on top" of the div. We’ll change that in the next section: