So, I am making a very simple image gallery for my artist friend, and I'm using max-height with percentages to allow the current image to be smaller than the browser window, but keep scrollbars away if it's not. This works fine in Chrome and Safari, but has no effect in Firefox or Opera. (I don't want to test on IE yet
)
example:
I'm not stuck on this by any means, I just need a way to cap the image's dimensions. What bothers me is that max-height works for other elements like divs and the like, but not for imgs apparently.
I would really appreciate a solution, using any language really. I mean, CSS would be optimal because it tends to be simple, but I've got PHP and Javascript in this already, so anything will work.
Thanks.
example:
Code:
img{ max-height: 80%; }
I'm not stuck on this by any means, I just need a way to cap the image's dimensions. What bothers me is that max-height works for other elements like divs and the like, but not for imgs apparently.
I would really appreciate a solution, using any language really. I mean, CSS would be optimal because it tends to be simple, but I've got PHP and Javascript in this already, so anything will work.
Thanks.