问题描述
我刚刚为客户建立了一个网站,基于他们发送给我的Photoshop文件,他们回来告诉我,PSD有125%的大小,他们应该是,他们需要缩小一切到现在的80%。
I just built out a website for a client, based on the Photoshop files they sent me, and they came back and told me that somehow the PSDs were 125% the size they were supposed to be, and that they need be to shrink everything to 80% of what it is now.
我想我需要重新剪切所有的图像,但我宁愿不重写CSS所以我正在探索替代方案。
I figure I'm going to need to re-cut all the images, but I would rather not rewrite the CSS so I'm exploring alternatives.
目前,所有值以像素为单位。我想知道如果我应该尝试找到一个脚本,将采取所有的像素值和乘以.8,或者如果我应该使用px到em转换器,然后将html标签的基本大小设置为80%,或者如果有更好的方法来解决这个问题。
Currently, all values are in pixels. I'm wondering if I should try to find a script that would take all the pixel values and multiply by .8, or if I should use a px to em converter and then set the base size in the html tag to 80%, or if there is better way to fix this problem.
推荐答案
Ugly css hack alert! :D
Ugly css hack alert! :D
html {
zoom: 0.8; /* Old IE only */
-moz-transform: scale(0.8);
-webkit-transform: scale(0.8);
transform: scale(0.8);
}
更新
显示最新的 Chrome 和 IE10 支持(并套用) 缩放
c $ c> transform 同时,缩放它两次,所以我建议在测试旧的IE浏览器时只使用 zoom
。
Update
It appears latest Chrome and IE10 supports (and applies) both zoom
and transform
at the same time, scaling it twice, so I recommend only using zoom
when testing old IE browsers.
这篇关于我需要将整个网站规模缩小到80%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!