Check if screen width is longer than height & vice versa - Can it be done?

HighS

New Member
So I've done a fair bit of reading on media queries and I get why for most situations just specifying a dimension and going after a device might be useful... But what if you're just looking for whether the device is portrait or landscape?What I really want is to be able to check if the screen whether the width or height is longest, and then run different CSS depending on the answer. Ideally I want to be able to do this all inline rather than running different external stylesheets.Any help much appreciated.
 
Back
Top