Question:
HTML Image Scaling Help?
Alex
2011-09-14 19:53:34 UTC
Okay, I have an image on a website, right? I want to do a liquid layout, and make it so the image keeps scaling out when you stretch the window. The problem is, when I go in full-frame on a window (2560X1440) the image is too big. I'd like to change the size with percentage, but I only want it to scale until it reaches 1280 X 220 (original size) no matter how big the window gets, I want it to stop at 1280 X 220. Any help on how to do this? Thanks!
Three answers:
2011-09-15 23:25:58 UTC
Using 100% for the width/height of an image is NOT maintaining the aspect ratio of the image. This will cause distortion or pixelation of the image if it is forced to "expand" larger than the original aspect ratio and resolution.



Ron
2011-09-15 03:33:27 UTC
Open the image with a program like paint or gimp and scale it down your self.in paint click on image at top menu bar and then click resize and skew and enter percent age you want to scale down then save file
2011-09-15 05:30:21 UTC
Try this:







Unfortunately Internet explorer falls behind when it comes to min/max width but there are other ways to accomplish this to work with most browsers



Other options

http://www.svendtofte.com/code/max_width_in_ie/


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...