And don't forget this, designing your site for 320 wide vertical browsers is designing it for almost certain obsolesence. Next year the ideal width will be 450 or whatever.
Once I get this working, I'll switch to max width, whatever the device, if possible.
combination of meta viewport and media queries
Thanks for the link. That is my next step.
Now, I'm using online browser simulators, and I wonder how that works. What I need is that whatever I use to check the website sends the real mobile user agent, like from the real device. I'm not getting my layout switch script to work when I use online simulators and I don't have any smart device on hand (as I still resist them personally and would rather live without mobile phone).