如果用户的分辨率< X? [英] possible to auto zoom out if user's resolution < x?

查看:112
本文介绍了如果用户的分辨率< X?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站纯粹针对笔记本电脑市场(不要问为什么或争论!),所有我的用户(或95%+)我们在屏幕宽度1200 +,


$ b $



如果您缩小一次(ctrl-minus),我的网站仍然看起来很漂亮的上网本, ,但我不想依赖用户知道ctrl-minus。



除了重新设计,我的选择是什么?



是否有javascript zoomer outer?!!! b $ b

解决方案

虽然这不能整理你的缩放,你可以尝试一个小技巧基于CSS&相对尺寸。



如果您有一个图像或 100px 宽的容器,请尝试将其设置为 10em wide(或者使用 em ),直到找到合适的值。最后,如果对网站上指定的每个维度执行此操作,您都可以通过更改默认值 font-size 来主动缩小页面大小。例如。从1em到0.91em。



人们经常使用相对大小,以允许人们能够随意缩小和增大字体大小的灵活性。它不像图像上常用的(因为它们是按需求,大小固定的)。这不一定是这种情况,在这种情况下,可能为您提供一个出路的全站点重新设计,并产生缩放的效果。



这可能会解决问题,而不需要重新设计,但可能是棘手的,将需要一点测试。样式表级联的方式,逐个缩小字体,逐个元素,可能会导致一些问题。


my site is aimed purely at the laptop market (dont ask why or argue!), all my users (or 95%+) we on a screen width of 1200+,

netbooks are now taking off, with a resolution of 1024 wide.

my site still looks great on a netbook if you zoom out once (ctrl-minus), but i don't want to rely on users knowing about ctrl-minus.

what are my options besides redesign? I'm keen not to have zoom buttons on my page.

is there a javascript zoomer outer?!!!

解决方案

While this doesn't sort out your zoom, you could try a little trick based on CSS & relative sizing.

If you have an image or a container that is 100px wide, try setting it to 10em wide (or faff with the em amount until you find the appropriate value). Eventually, if you do this to every single dimension specified upon your site, you'd be able to actively shrink the page by changing the default font-size. E.g. from 1em, to 0.91em.

People often use the relative sizing to allow people the flexibility of being able to shrink and grow font sizes as they want. It's not as commonly used on images (because they are by requirement, fixed in size). This needn't be the case though, and in this instance, might offer you a way out of a "full site redesign" and giving the effect of "zooming".

This might solve the problem without redesign, but may be tricky and would require a bit of testing. The way stylesheets cascade, shrinking the font a little more, element by element, might cause a few issues.

这篇关于如果用户的分辨率< X?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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