|
![](/i/fill.gif) |
>>> I get a pleasant result (at least in preview from Firefow) with
>>> img {max-width: 17cm; max-height: 24cm; background: white ;color:#000; }
>>
>> This requires you to know what the dimensions of the paper are, and what
>> the correct aspect ratio of every image is.
>
> Yes and No.
> Notice we set max-*, not width& height... so the max-* does not define
> any ratio: in firefox preview, at worst one of the max is inforced (and
> the other dimension remains lower) if the number of pixel reach the
> dimension... If the picture is smaller, it is not expanded.
> (Problem: we do not have access to the DPI either!)
Yes. And I had *hoped* that by setting only the maximum width, Firefox
would figure out that the height should be similarly adjusted. But no...
> the problem with "100%" is that it is relative to the container... an
> absolute size would be better: I used "cm" but you can search for some
> units more appropriate (hint: CSS3 vm/vh/vW ?) (viewport...)
Yes. And if the container is the entire page, it means that the image
ends up the exact right size for whatever size of paper you happen to be
using (which I cannot know ahead of time).
Post a reply to this message
|
![](/i/fill.gif) |