Html 缩放 css 属性在 Firefox 上不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19449184/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
zoom css property is not working on firefox
提问by Sumit Raghav
I searched for this and found many solutions (using css3 transition).
我搜索了这个并找到了许多解决方案(使用 css3 过渡)。
Actually i am using {zoom:1.5}
for all my buttons. But it is not working on firefox.
when I use transition property like:
实际上我正在使用{zoom:1.5}
我所有的按钮。但它不适用于 Firefox。当我使用过渡属性时:
-moz-transform: scale(1.5); /* Firefox */
-moz-transform-origin: 0 0;
All my buttons are overlapping. See ok and cancel button.
我所有的按钮都是重叠的。看到确定和取消按钮。
Is there any other alternative for this?? any help??
有没有其他选择呢??任何帮助?
回答by ricardo
To scale 50% and keep top center:
要缩放 50% 并保持顶部居中:
transform: scale(0.5);
transform-origin: 50% 0;
This did work with Safari/Firefox/Chrome (I did not test with IE)
这确实适用于 Safari/Firefox/Chrome(我没有用 IE 测试)
回答by Karim Ali
You can use:-
您可以使用:-
-moz-transform: scale(0.8);
in firefox as alternative..
在 Firefox 中作为替代..
回答by Philip Rego
What others have posted isn't feasible because the image will still take the same amount of space. Granted the image size doesn't need to resize programmatically, you can scale the image using Gimp, and remove zoom.
其他人发布的内容不可行,因为图像仍将占用相同的空间。授予图像大小不需要以编程方式调整大小,您可以使用 Gimp 缩放图像,并删除缩放。
Image | Scale Image
图像 | 缩放图像
File | Export As...
档案 | 导出为...
回答by OJFord
It was a combination of the existing answers that did it for me:
这是现有答案的组合,为我做到了:
-moz-transform: scale(...);
-moz-transform-origin: 0 0;
With 50% 0
as ricardo's answer suggesst for the latter option there was a left margin.
随着50% 0
李嘉图的回答suggesst后者选项有一个左边距。
回答by Faz Ahmad
put transform: scale(0.5); instead of zoom:0.5px, this will work. may be you have to change margins accordingly
放置变换:比例(0.5);而不是缩放:0.5px,这将起作用。可能您必须相应地更改边距