Print Reseller Scheme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Image problem

Discussion in 'Website Design Forum:' started by pjohnstone, Dec 1, 2011.

  1. pjohnstone

    pjohnstone Member

    Hi all,

    Looking for a wee bit of advice. I have three images on the front page of a website I work on. Each image has the dimensions of 195 by 135 pixels.

    These images are added by the user to the specific post and then using PHP we pull this image onto the front page and size it to 195 by 135.

    See here: Cue Entertainment | The entertainment business in high definition (see the image are on the right side half way down to see the three images)

    My problem is that if the image is not a similar ratio then the image looks squashed (i.e. a portrait image) so my question basically is there a way to put the image into the DIV and it resizing it accordingly, but will not change the size of the DIV - a bit like a background image but not.

    So it almost sits behind the DIV and aligns top left.

    I have scratched my head on this one for months and just can't find a way to possibly do it!

    QUICK EDIT: Forgot to mention that I want the image to remain 195 pixels in width, but for the height to cut off if its too big.
     
  2. br3n

    br3n Senior Member

    can't you use

    img {max-width: 100%} and then size the div accordingly?
     

Share This Page