How do I lock the orientation to portrait mode in a iPhone Web Application?
问题 I'm building a iPhone Web Application and want to lock the orientation to portrait mode. is this possible? Are there any web-kit extensions to do this? Please note this is an application written in HTML and JavaScript for Mobile Safari, it is NOT a native application written in Objective-C. 回答1: You can specify CSS styles based on viewport orientation: Target the browser with body[orient="landscape"] or body[orient="portrait"] http://www.evotech.net/blog/2007/07/web-development-for-the-iphone