有没有办法使页面布局完美地适合100%缩放,但还要尊重更大的缩放系数? [英] Is there a way to make page layout fit perfectly at 100% zoom but also respect greater zoom factors?

查看:984
本文介绍了有没有办法使页面布局完美地适合100%缩放,但还要尊重更大的缩放系数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有几种方法可以布局网页,使其适合浏览器视口(DOM window )。当我说fit时,我包括改变所用字体的大小,改变DIV,IMG和其他渲染元素的宽度和高度,以及允许元素的流动移动。目标是让所有显示设备上的页面看起来漂亮,从小手机到大型桌面屏幕。这些布局方式包括使用CSS em 大小,文本和元素的换行以及由< c $ c> onload 和 onresize 事件。布局拟合可以做得几乎完美,跨浏览器,但复杂的结果可能不敏感的浏览器缩放,因为缩放改变窗口宽度魔法,这意味着没有任何独立于浏览器,可靠的方式来检测缩放(DOM和CSS标准忽视浏览器缩放)。没有办法检测由于小的设备屏幕导致的小窗口宽度与由于大的缩放因子导致的小窗口宽度之间的差异。我们希望以不同的方式处理这两种情况,因为视力受损的用户需要获得缩放因子。

There are several ways to layout web pages so they fit the browser viewport (DOM window). When I say "fit" I include changing the size of the fonts used and changing the width and perhaps heights of DIVs, IMGs, and other rendered elements, as well as allowing "fluid" movements of elements. The goal is to make the page look "nice" on all display devices, from tiny phones to big desktop screens. These layout ways include using CSS em and % sizes, wrapping of text and elements, and JavaScript run by the onload and onresize events. Layout fitting can be made to work almost perfectly, cross-browser, but a sophisticated result may be insensitive to browser zooming, since zooming changes the window width magically, which means without any browser-independent, reliable way to detect the zoom (DOM and CSS standards ignore browser zooming). There is no way to detect the difference between a small window width due to a small device screen versus a small window width due to a large zoom factor. We want to handle these two cases differently, since vision-impaired users need the zoom factor to be honored.

任何人都能成功地完成布局布局(包括改变字体大小)在某种程度上尊重缩放?例如,如果用户以200%的缩放访问页面,则最初只应该显示页面的左上四分之一(其余的可通过水平和垂直滚动来获得),而同一页面将完全适合于窗口

Has anyone succeeded in fitting layout really well (including changing font sizes) in a way that respects zooming? For example, if the user visits the page with a zoom of 200%, initially only the upper left quarter of the page should be shown (the rest being available by scrolling horizontally and vertically), while the same page would fit into the window perfectly for another user having their zoom set to 100%.

推荐答案

确实有一个流畅的布局,你必须使用%来确定宽度而不是像素。
并适合屏幕使用100%

Indeed to have a fluid layout you will have to use % to determine the width instead of pixels. And for fitting the screen use 100%

这篇关于有没有办法使页面布局完美地适合100%缩放,但还要尊重更大的缩放系数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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