本文介绍了transform:scale vs传统调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 transform:scale(x.x)
有没有任何缺点,而不是使用width和height属性进行传统调整大小?缩放是否产生较低质量的图片或某些?
Are there any drawbacks of using transform: scale(x.x)
instead of doing traditional resizing with the width and height properties? Does scaling produce a lower quality image or something?
推荐答案
缩放
一个更好的质量结果(从视觉的角度来看),因为许多浏览器使用高级重采样算法通过GPU渲染它(换句话说,使用硬件加速),但是它有一个缺点:
Scale
generates a general better quality result (from a visual point of view) because many browsers render it via GPU (in other words, with hardware acceleration) using advanced resampling algotithms, but it has a drawback:
缩放对象不会在其周围创建大于其原始大小的空格
Scaled object does not create a space around it, larger than its original size.
行为是以下(大约):
- 以原始大小呈现对象A
- 放置其他对象(直到此点浏览器完全忽略
scale
规则声明) - > 缩放A,重叠其他类似的图层。
- Render of the object "A" in its original size
- Placing of other objects around it (until this point browsers completely ignore
scale
rule declaration) - At the end, "visually" scaling of "A", overlapping others like it would be in a different layer
这篇关于transform:scale vs传统调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!