css transform: translate() % always refer to the size of bounding box?
我对规格说明感到困惑。
让我澄清一下我的理解。
规格
https://www.w3.org/TR/css-transforms-1/#propdef-transform
Percentages: refer to the size of bounding box
https://drafts.csswg.org/css-transforms-2/#propdef-translate
Percentages: relative to the width of the
containing block (for the first value) or the height (for the second value)
我的理解
css-transforms-1
有
因此,
没有
css-transforms-2
有
因此,
有
因此,我认为
这是正确的吗?
您的第二个链接只是用于讨论的草稿。 据我所知,它还没有成为最终的CSS标准或实现。
因此,您的猜测是正确的,百分比与元素的边界框相关,而不与包含块相关。