#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2007
    Posts
    113
    Rep Power
    0

    Thumbs down Resize image proportionally and crop


    Hello

    I'm trying to resize an image to a set width and height: 1000px x 460px, keeping the aspect ratio and cropping what isn't needed. The css I've used is:

    Code:
    .image-cropper {width: 1000px; height: 460px;}
    .centered {width: 100%; height: auto;}
    html
    Code:
    <li>
    <div class="image-cropper">
    <a href="blog.php?id='.$fetch['id'].'"><img class="centered" src="'.$fetch['photo'].'" /></a>
    <div class="flex-caption">
     <p><a href="blog.php?id='.$fetch['id'].'">'.$fetch['title'].'</a></p>
       </div>
    </div>
    </li>
    It does pretty much what I want, but if you go here you'll see the excess height isn't cropped.

    Any help would be appreciated.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2007
    Posts
    113
    Rep Power
    0
    Got it sorted. Just need overflow=hidden. I really should have thought of that.

IMN logo majestic logo threadwatch logo seochat tools logo