image to photo.
This little trick gives your image a bit of a white border around the edges, just like photos in real life often have. Like this:
.photo img {
border: 1px solid #999;
background-color: #fcfcfc;
padding: 4px;
}
You can see the results here. What we’ve done is added a gray border to all four sides, changed the background color of the image to a very pale gray (almost white), and then added a bit of padding to all four sides between the background and the image itself, so the background color could show through. And you’ll note we used a class of “photo” here: this way, we can pick and choose in our code which images get this treatment.





