简体   繁体   中英

Viewport meta tag for fixed width but scaled to device-width

Our website has two separate versions for mobile and desktop, and our mobile version needs to have a fixed width that is displayed on all devices in the same way. The website is currently using:

<meta name="viewport" content="width=750; user-scalable=no" />
<meta name="MobileOptimized" content="750">

It works for most cases just fine, our mobile version has 750px width and is scaled to the viewport-size of the device and is not scalable. We now found out that on older Android devices it doesn't work (tested until 4.3, maybe later versions are affected, too).

[edit: The problem also only seems to apply to the native Android Browser. Chrome displays it correctly.]

The page that loads has 750px width, but is not scaled, so it is too large and doesn't fit and the user only sees a part of the page. It is also scalable, which means the user-scalable= no isn't working, either.

(Responsive Layout is not an option for us, btw. We need the mobile page to be exactly 750px wide).

您也可以尝试以下代码:

<meta name="viewport" content="width=750px, initial-scale=1, maximum-scale=1, user-scalable=no">

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