开发者

Center website in iPhone landscape mode with meta viewport

开发者 https://www.devze.com 2023-01-18 06:19 出处:网络
I have a CSS border on the HTML tag of my site, when I viewed it on the iPhone it didn\'t respect the border as part o开发者_StackOverflowf the width and some of the div\'s overlap as oppose to having

I have a CSS border on the HTML tag of my site, when I viewed it on the iPhone it didn't respect the border as part o开发者_StackOverflowf the width and some of the div's overlap as oppose to having a 10px gap between content and the sides of the screen. I used the meta viewport tag

<meta name="viewport" content="width=device-width, initial-scale=auto">

and this worked well as it now all lines up perfectly, however when I view the site in landscape mode the site is not centered, it starts off left aligned so you only see half the site until you scroll across.

How can I center the layout of the site when it is viewed in landscape mode?


Given that this question is now a little 'old' not sure if you solved your problem, but this link may help others. It helped me.

I've recently been looking at meta-viewport and came across this website article.

The Viewport meta-tag

Basically, dont use "width=device-width".
Instead just use "initial-scale" values.

0

精彩评论

暂无评论...
验证码 换一张
取 消