When I write my games that need to work in either orientation I use a 'square' screen (I set the screen width the same as the height), I then put it to letterbox mode and use the extra space by using the application API to figure out what the boundaries are.
Anyhow, for a particular game I wanted to force HTML5 to look like a portrait game, but most desktop users have a landscape viewer. So, how to make this work?
I exported to html5 as normal, then renamed the index.html to index2.html. After this I added the following to a text file and saved it as index.html
<iframe frameborder=0 width=480 height=850 scrolling=no src="<a href="https://sinistersoft.com/PingPongDX/index2.html"></iframe>" target="_blank" rel="nofollow">https://sinistersoft.com/PingPongDX/index2.html"></iframe></a>;
Then I uploaded the files and the game looks portrait.
Here is the url for the game I'm working on (if you're interested):https://www.sinistersoft.com/PingPongDX/
And here it is without the forced portrait:https://www.sinistersoft.com/PingPongDX/index2.html
Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).https://deluxepixel.com