Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Crop Image Size Re: [Solved] Crop Image Size

#77385
Lynz
Member

This seems to work pretty well:

<div style="width:300px; height:150px; overflow:hidden;">

<img style="position:relative; top:-25px;"src="original.jpg" width="300" height="224" />

</div>

(of course you can externalize the CSS if you want)

Basically put the image inside a div, give the div a set height (150) and set the overflow to hidden. Then you adjust the positioning of the image to set it where you want within the div.