Select Styling based on device orientation


In my Ionic 2 app I have pages which contain an image and a block of text. When landscapel I want the image on the right and the text on the left. When the device is portrait I want the image at the top and the text at the bottom.

What is the best way to do this? I imagine putting the image and text in

tags, where the class is dependent on orientation. Is that possible?

Thanks for any hints.


So I have solved the first problem - how to assign different styles in code. See

Now I just have to work out when up is up and not left!