|
Posted by no-spam on March 30, 2005, 2:07 am
Please log in for more thread options
hmmm... I've had a chance to try a couple of things.
1) <div style="overflow:hidden; width:200"><img width="100%"
src="image.jpg"></div>
This appears to be equivalent to <img width="200" src="image.jpg">, having
the same problem -- images are sized beyond their original dimensions, and
there's no control over the height.
2) <div style="overflow:hidden; width:200 height:200"><img width="100%"
src="image.jpg"></div>
Like 1) but with cropping on the Y axis
3) <div style="width:200; height:200"><img width="100%" src="image.jpg">
</div>
Displays a 200-wide image in a really big div
4) <div style="overflow:hidden; width:200"><img src="image.jpg"></div>
Cropped but not scaled
It seems no combination of div and img does any good. What I'm still
looking for is a way to set maximum dimensions (i.e. 200x200) and "scale"
(not crop) the image to fit inside that box, while preserving aspect
ratio, and not scaling the image beyond its original size. I'm not sure it
can be done with the current HTML standard...
-----------------------------------------------------------
> Posted using QuadSucker/News, http://www.quadsucker.com > ... the ultimate tool for newsgroup downloading!
-----------------------------------------------------------
|
|
Posted by C A Upsdell on March 29, 2005, 10:41 pm
Please log in for more thread options
no-spam@no-spam.com wrote:
> hmmm... I've had a chance to try a couple of things.
>
> 1) <div style="overflow:hidden; width:200"><img width="100%"
> src="image.jpg"></div>
> This appears to be equivalent to <img width="200" src="image.jpg">, having
> the same problem -- images are sized beyond their original dimensions, and
> there's no control over the height.
>
> 2) <div style="overflow:hidden; width:200 height:200"><img width="100%"
> src="image.jpg"></div>
You have failed to specify units for width and height. 200 what?
inches? points?. light-years? or (maybe, just maybe) pixels.
(Note that browsers are supposed to ignore CSS that they can't
understand: this includes invalid CSS.)
|
|
Posted by Alan J. Flavell on March 30, 2005, 10:57 am
Please log in for more thread options
On Tue, 29 Mar 2005, C A Upsdell and MISSINGcupsdellXXX"TERMINATOR wrote:
> You have failed to specify units for width and height. 200 what?
> inches? points?. light-years? or (maybe, just maybe) pixels.
>
> (Note that browsers are supposed to ignore CSS that they can't
> understand: this includes invalid CSS.)
Not just "supposed to ignore", but in certain defined situations
"required to ignore". AFAIK this is one of those defined
situations.[1] Any browser which ignores that mandate does not support
CSS (it supports some CSS-like language of its own, but not CSS as
defined by the W3C).
[1] section 4.2 in the CSS 2 (or 2.1 proposed) specs.
|
|
Posted by Mark Parnell on March 30, 2005, 12:31 pm
Please log in for more thread options
said:
> hmmm... I've had a chance to try a couple of things.
Congratulations. However, I have no idea what you are talking about, or
who you are replying to, so I have no way of knowing what you are
actually trying to do (except the cryptic subject line).
>> Posted using QuadSucker/News, http://www.quadsucker.com
Please configure your "newsreader" to quote appropriately, and send the
proper headers to allow your post to appear in the correct thread. Thank
you.
--
Mark Parnell
http://www.clarkecomputers.com.au
|
| Similar Threads | Posted | | Restricting inline image size | March 29, 2005, 6:56 pm |
| Re: Restricting inline image size | March 29, 2005, 9:24 pm |
| Inline-Element with higher font-size inside A: Hover about full height? | November 21, 2006, 7:55 pm |
| fixed image size | February 12, 2007, 1:53 pm |
| Display larger size image | August 6, 2004, 11:56 pm |
| client-side image size changing question | June 22, 2005, 6:26 am |
| restricting width of div | October 20, 2004, 8:06 am |
| Firefox - Prevent TextField size change when user changes font size? | October 3, 2006, 6:21 pm |
| Creating image maps with Adobe Illustrator or Image Ready. | March 8, 2005, 12:42 pm |
| How to lauch an image editor when click on an image link ? | November 8, 2004, 7:00 am |
|