Is there a way to make an image fit within a window using HTML?

Message Bookmarked
Bookmark Removed
I searched Yahoo, and could find nothing. It's driving me up the wall. Posting images and having to scroll left and right to see the entire thing is a hassle, but going photo by photo and re-sizing them would be an even bigger hassle. Any way to just use some HTML trick to make them fit within a window?

David Allen (David Allen), Thursday, 13 January 2005 16:36 (twenty-one years ago)

No. Otherwise they'd all be doing it most probably.

mark grout (mark grout), Thursday, 13 January 2005 16:38 (twenty-one years ago)

use image size tags. Explanation (better than the one I could give) here:

http://www.mediacollege.com/internet/html/image-tag.html

Pashmina (Pashmina), Thursday, 13 January 2005 16:40 (twenty-one years ago)

you can do it for a pop up window with php and javascript type thing

jellybean (jellybean), Thursday, 13 January 2005 16:42 (twenty-one years ago)

a lot of browsers these days have a "resize images to fit window" option (in fact i think it's the default on IE and as an advanced->multimedia option in firefox).

you'll lose quality when you resize using image tags or the browser btw as the routines that do it are fast rather than good. whether this bothers you depends on what you're using it for i guess.

koogs (koogs), Thursday, 13 January 2005 16:49 (twenty-one years ago)

can you not use javascript to change the height/width attributes of a named img tag?

Jaunty Alan (Alan), Thursday, 13 January 2005 17:17 (twenty-one years ago)

width="85%" moron

LSD ARISTOCAT (ex machina), Thursday, 13 January 2005 17:19 (twenty-one years ago)

i was going to suggest a percentage width but i don't know if it was 'kosher'.

Stevem On X (blueski), Thursday, 13 January 2005 17:22 (twenty-one years ago)

there's a freeware program called easy thumbnails that's pretty good, maybe you could just use that to reduce the real size of the picture a little bit?

teeny (teeny), Thursday, 13 January 2005 17:26 (twenty-one years ago)

here's the problem with using height and width percentages, morans, you're file's still the same file size and users still have to download extra K that they won't be using. totally lame. just set an action in photoshop to batch shrink all your images

JaXoN (JasonD), Thursday, 13 January 2005 18:06 (twenty-one years ago)

yeh but how long does that extra K take in this day and age? i would never do the percentage thing as it happens, just shrink the image to fit!

Stevem On X (blueski), Thursday, 13 January 2005 18:16 (twenty-one years ago)

I'm at work, no photoshop here. Id be using MS Paint for hours, and I already have the originals uploaded

David Allen (David Allen), Thursday, 13 January 2005 18:33 (twenty-one years ago)

yeh but how long does that extra K take in this day and age?

but if the person is uploading super highres images and needs them to be super small, it's just a waste of time. what if the original image is 1mg and the shrunk down images were like 150k, that'd be a considerable amount of time, especially if there are many, many images.

JaXoN (JasonD), Thursday, 13 January 2005 19:04 (twenty-one years ago)

I ended up just using ms paint to find the image attributes and then divided the width and height by 2 and used that in the html. It wasnt perfect, but the phoros werent warped and they fit.

David Allen (David Allen), Thursday, 13 January 2005 19:33 (twenty-one years ago)

u sux

JaXoN (JasonD), Thursday, 13 January 2005 19:44 (twenty-one years ago)

kisses

JaXoN (JasonD), Thursday, 13 January 2005 19:44 (twenty-one years ago)


You must be logged in to post. Please either login here, or if you are not registered, you may register here.