简体   繁体   English

网站适合平板电脑在屏幕上显示,视口不起作用?

[英]Website fit on screen for tablets, viewport not working?

I've built a webshop with opencart, with a theme that was originally responsive. 我用opencart建立了一个网上商店,其主题最初是响应式的。 However, the owner wanted exactly the same website on all platforms, so I simply removed a seperate responsive.css file and fixed the issue. 但是,所有者希望在所有平台上使用完全相同的网站,因此我只删除了一个单独的响应.css文件并解决了该问题。 However, I would like the website to fit on screen when I open it on my tablet. 但是,当我在平板电脑上打开网站时,我希望它可以显示在屏幕上。 That isn't working though. 那是行不通的。 I have this in the header of my page: 我在页面的标题中有这个:

<meta name="viewport" content="width=device-width">

Shouldn't that fix it? 那不应该解决吗? Thanks! 谢谢!

Try this: 尝试这个:

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

It is working for me. 它为我工作。

Use the below meta code hope it will solve your issue 使用下面的元代码希望它能解决您的问题

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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