简体   繁体   中英

Viewport not sizing correctly on Android

I got a weird problem with the viewport. On iPhone & Android landscape it looks great, but in Android portrait mode it looks horrible.

Here is my meta tag:

<meta name="viewport" 
      content="user-scalable=no; width=device-width; target-densityDpi=device-dpi"/>

Images below:

三星景观三星人像

Try using commas instead of semicolons as delimiters. Also, I wouldn't bother with target-densityDpi=device-dpi as it's only supported in older Android browser versions and does more harm than good.

So, that would give you:

<meta name="viewport" content="user-scalable=no, width=device-width "/>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM