I'm running a small application which has an 70% width, and 90% height value, as the rest of the screen is menus.
In this space I need to echo images which isn't problem, but if the image is too big it creates an overflow. If have fixed properties for the image depending on what the images' original size is, it will destroy the quality or look of t开发者_如何学Che image. Can someone tell me how it is possible to echo the image without overflowing or destroying the images quality?
Something along the lines of how Facebooks image viewer works.
Don't constrain both width and height then.
Constrain one or the other and let the browser resize the image according to its ratio. If you tell the browser to resize your 100x100 image to 60x2, it's going to look terrible, no matter what. But if you tell your browser to resize your image to height 60, it will automatically make the width 60 to keep the image's proportions, and it won't be distorted.
If you want to go with an image gallery, you can. Here's one that looks similiar to facebook's from a quick google : http://phpimagegallery.com/
精彩评论