A transformable element is an element in one of these categories:
an element whose layout is governed by the CSS box model which is either a block-level or atomic inline-level element, or whose display property computes to table-row, table-row-group, table-header-group, table-footer-group, table-cell, or table-caption [CSS21]
an element in the SVG namespace and not governed by the CSS box model which has the attributes transform, ‘patternTransform‘ or gradientTransform[SVG11].
We should note that not all the inline elements cannot be transformed but only the non-replaced inline elements thus the replaced inline elements can be transformed.
So basically we can apply transformation to img, canvas, etc without the need of making them inline-block or block
使用 transform 的时候,部分 inline 元素不会生效。
transform 对于可替换元素是生效的
一下说明了有哪些 inline 元素可以有效的使用 transform
翻译:
参考:
CSS transform doesn't work on inline elements
The Transform Rendering Model