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?
相关问题
- Views base64 encoded blob in HTML with PHP
- How to get the background from multiple images by
- Adding a timeout to a render function in ReactJS
-
Why does the box-shadow property not apply to a
- Add animation to jQuery function Interval
transform:scale();
will not expand or shrink initial space used by your element.a 100px square may look 200px , but will still use 100px² on screen . it will overlap what's around.
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.
Practically.... Browsers' behaviour is the following (approximately):
scale
rule declaration)