为桌面浏览器使用meta viewport标签设置视口 [英] set viewport using meta viewport tag for desktop browsers

查看:260
本文介绍了为桌面浏览器使用meta viewport标签设置视口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户端提供的宽度1440像素的网站。客户要求我使用桌面浏览器的
将视口设置为1440像素,以便对于小于1440像素的屏幕不显示滚动条。

I have a client provided website of width 1440 pixels. The client has asked me to set the viewport to 1440 pixels using for desktop browsers so that for screens smaller than 1440 pixels do no show a scrollbar.

它确实适用于移动ipad设备,我们可以在其中使用此设置视口。

It does work for mobile, ipad devices where we can can set the viewport using this. Does this work for desktop browsers as well?

我尝试使用此方法设置视口,但可以看到滚动条。有人可以对此提供一些想法。

I tried setting the viewport using this but could see a scrollbar. Could someone provide some thoughts on this.

代码:

   <!DOCTYPE html>
     <html>
     <head>
     <meta name="viewport" content="width=1440">

     </head>
    <body>
<div style="width:1440px;">
    test content
 </div>


 </body>
</html>

谢谢

推荐答案

首款iPhone发行时,它需要能够显示旨在在更大显示屏的计算机上查看的网页。由于那几乎是所有网站,因此默认情况下会执行缩放技巧以假装具有该大小的显示器。

When the first iPhone was released, it needed to be able to display webpages designed for viewing on computers with much larger displays. Since that was almost all websites, it defaulted to performing zoom tricks to fake having a display that size.

引入了元视口,以便作者可以告诉iPhone他们知道他们正在做什么并且实际上已经考虑过移动大小的设备。

Meta viewport was introduced so that authors could tell the iPhone that they knew what they were doing and had actually considered mobile sized devices.

计算机屏幕大小的显示器从不需要它,因此从未引入对元视口的支持。在移动浏览器之外。

There was never a need for that on computer screen sized displays, so no support for meta viewport has ever been introduced outside of mobile browsers.

这篇关于为桌面浏览器使用meta viewport标签设置视口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆