css3 translate in percent

后端 未结 2 1809
太阳男子
太阳男子 2020-12-31 13:46

I am stuck on defining an css3 cube completely with percent.

Here a short example in Codepen

http://codepen.io/anon/pen/detAB

As you can see the cub

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-31 14:33

    The percentage there is not of the parent container in the way you might expect but of the element itself. The spec describes it as:

    [The percentage] refer[s] to the size of the element's box

    Regarding %s, the spec says:

    Note that values are not allowed in the translateZ translation-value, and if present will cause the propery value to be invalid.

    Though, it seems that instead, they aren't valid in any of them for Chrome at least.

    Sorry :(

提交回复
热议问题