Yes, simply open the .html file with Chrome or Firefox. These browsers have device mode.
You can change the screen size and see how it looks on mobile or tablet sized screens.
Answer from Hans on Stack OverflowVideos
Is this HTML Viewer tool free?
What can I use the HTML Viewer for?
Does the viewer execute JavaScript?
Yes, simply open the .html file with Chrome or Firefox. These browsers have device mode.
You can change the screen size and see how it looks on mobile or tablet sized screens.
If you save your file .html you can open with firefox or chrome, but i suggest you to use firefox developer edition https://www.mozilla.org/it/firefox/developer/
If you use Firefox you can put in the menu -> development -> flexible display (ctrl+shift+m)
In Chrome (ctrl+maiusc+i + emulation)
In this page you can select the device to view.
I considered it a no-brainer. I was wrong.
I wanted to take along some files to read when I'm out of network reach or in flight mode. The files happen to be quite plain HTML files, no script, just a CSS file defining the simple layout, and that's it. So I copied the HTML and the CSS files onto my phone and tried to open them.
First attempt was from a file manager. It told me that it no idea what to do with an HTML file. I then tried to look for an "open file" entry in Chrome. Nope. Same in Firefox. Then I tried to force-open the files by using a file:///path/to/file style URL - and it actually submitted the whole string to Google as a search string, as if Chrome (and Firefox) had been lobotomized of the file: protocol.
Now I'm at a loss - is there no way to open a simple HTML file on an Android 13 phone?