如何在页面加载时提高浏览器缩放级别? [英] How to Increase browser zoom level on page load?

查看:248
本文介绍了如何在页面加载时提高浏览器缩放级别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在网页载入时提高浏览器缩放级别?

How to increase browser zoom level on page load?

这里是我的网页链接最近我得到了增加其宽度的任务,就像Firefox,我们按 Ctrl + 和浏览器缩放级别是增加是有任何方法来自动执行此操作所有浏览器在网页加载。

here is my web link recently i got the task to increase its width just like if Firefox we press Ctrl + and browser zoom level is increases is there any way to do this automatically in all browsers on page load.

推荐答案

我个人认为这是一个坏主意;要么设计您的网站,使其容易缩放(不适合适当的CSS / HTML技术)或只是允许用户做他们想要的(也许他们已经有他们的浏览器缩放或他们使用低分辨率)。通常你不应该为人们做用户体验决策。

Personally I think this is a bad idea; either design your site so it scales easily (not hard with proper CSS/HTML techniques) or just allow the user to do what they want (maybe they already have their browser zoomed or they use low resolution). Typically you should not make UX decisions for people.

但它是可能的。

演示: http://jsfiddle.net/q6kebgbh/4/

.zoom {
    zoom: 2;
    -moz-transform: scale(2);
    -moz-transform-origin: 0 0;
}

请注意,此答案的以前版本使用 transform 以支持更多浏览器。但是,这种缩短的代码似乎适用于当前版本的Chrome,FF,Safari和IE(以及早期支持 zoom 很长时间的IE版本) 。

Note that previous versions of this answer used transform to support more browsers. However, this shortened code appears to work for current versions of Chrome, FF, Safari and IE (as well as previous versions of IE, which have supported zoom for a long time).

这篇关于如何在页面加载时提高浏览器缩放级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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