Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS full width if landscape, half width if portrait Reply To: full width if landscape, half width if portrait

#245492
tagarelamidia
Participant

Thanks for the prompt reply, Beverleyh. Apologies for my belated response.

I’m trying to do this as custom CSS for WordPress. I’ve customised the alignright and alignleft classes to set the image to half the width of the container, and defined a fullwidth class. What I’m doing manually is tagging each landscape image as fullwidth. I now realised I don’t need the half-width, as that’s already working. What I do need is, if I set an image as aligncenter, that it be fullwidth if it’s landscape, i.e. if width > height, or leave it as it is otherwise.

Sense?