a simple CSS problem:
- Display animal pictures in the grey box as shown in the picture below
- Image size must be 150x150 px
- However, I must maintain the aspect ration of the image, meaning not the whole of the image will fit into the 150x150 square.
- Since most of the images will exceed the allowed 150x150 dimensions, i would like to focus the display on the middle of the image.
Some HTML:
<div class="gallery-item" style="height: 232px;">
<img src="/media/animals/images/african-buffalo.jpg" alt="African Buffalo ">
<div class="gallery-item-caption">
<a href="/animals/african-buffalo" title="African Buffalo ">African Buffalo </a>
</div>
</div>
Some CSS:
.gallery-item {
float: left;
padding: 15px 15px 15px 15px;
margin: 15px;
background-color: #ececec;
}
View: