On Fri, Aug 7, 2020 at 3:34 PM Aaron Gray <aaronngray.li...@gmail.com> wrote:
>
> On Fri, 7 Aug 2020 at 18:14, Tom Livingston <tom...@gmail.com> wrote:
> >
> > Sorry if I am being dense as to what you're after, but your original
> > code works - I think - without the portrait and landscape classes:
> >
> > https://tomliv.com/css-d/portraitlandscape/index3.html
>
> Tom, that looks brilliant, is it the width: auto, height: auto, and
> max-width: 100%, and max-height: 100% that do the trick ?
>
> This will save a lot of work, I may well still allow overrides, as was
> implicitly suggested by Wade, so as to provide a general solution. I
> also found some JavaScript code for this working from the EXIF data,
> or my .json image list file format, but I would have thought the EXIF
> orientation would have already been applied. I will look into this.
>
>     https://gist.github.com/runeb/c11f864cd7ead969a5f0
>
> Many thanks !
>
> Aaron
>

Looping in the list here...

It is the max-width and max-height that's working here.

The only issue would be if the images are narrower than the .thumbnail
divs, in which case they wouldn't fill the div.

I am able to remove the width and height in the web inspector as well
and still get the same result, though that's in a modern browser. Auto
is the default value for width anyway.

Test test test!

Glad to help. Good luck.






--

Tom Livingston | Senior Front End Developer | Media Logic |
ph: 518.456.3015x231 | fx: 518.456.4279 | medialogic.com


#663399
______________________________________________________________________
css-discuss [css-d@css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to