【问题标题】:How can I wrap a container around its css-transformed contents?如何将容器包裹在其 css 转换的内容周围?
【发布时间】:2012-12-24 04:40:16
【问题描述】:

当我使用scalerotate 时,父元素会换行到元素的翻译前尺寸的大小。

JSFiddle Example

有没有办法用 CSS 将父容器包裹在转换后元素的边界框周围,还是我需要使用数学来手动定位东西?

【问题讨论】:

标签: javascript html css webkit css-transforms


【解决方案1】:

Based on this earlier question 听起来您需要使用一些数学和 JavaScript 来更改包装器。

通过使用答案中的函数,您可以根据刚刚计算的尺寸设置包装器尺寸。

【讨论】:

    猜你喜欢
    • 2016-06-16
    • 2015-11-08
    • 2019-07-22
    • 2021-02-12
    • 1970-01-01
    • 2016-07-22
    • 2021-11-09
    • 1970-01-01
    • 2013-01-07
    相关资源
    最近更新 更多