gpt4 book ai didi

css 变换 : translate() % always refer to the size of bounding box?

转载 作者:行者123 更新时间:2023-11-28 10:13:00 24 4
gpt4 key购买 nike

我对规范说明感到困惑。让我澄清一下我的理解。

规范

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

  1. transform属性。
    transform 属性指的是边界框。
    因此,transform 属性的 translate 函数引用了边界框。

  2. not translate 属性。

css-transforms-2

  1. transform属性。
    transform 属性是指边界框的大小。
    因此,transform 属性的翻译函数是指边界框。

  2. translate 属性。
    translate 属性指的是包含框。

所以,我认为 % of transform: translate() 总是指边界框,
这样对吗?

最佳答案

您的第二个链接只是用于讨论的草稿。据我所知,它还没有成为最终的 CSS 标准或实现。

所以你的猜测是正确的,百分比与元素的边界框有关,而不是包含 block 。

关于css 变换 : translate() % always refer to the size of bounding box?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39638045/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com