如何将容器包装成经过CSS转换的内容? [英] How can I wrap a container around its css-transformed contents?

查看:67
本文介绍了如何将容器包装成经过CSS转换的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 scale rotate 时,父元素会自动包装为



听起来您将需要使用一些数学和JavaScript来更改包装器。



通过使用答案中的函数,您可以根据自己的尺寸设置包装器尺寸


When I use scale or rotate, the parent element wraps to the size of the pre-translation dimensions of the element.

JSFiddle Example

Is there any way to wrap the parent container around the bounding box of the transformed element with CSS, or do I need to use Maths to manually position things?

解决方案

Based on this earlier question it sounds like you will need to use some math and javascript to change the wrapper.

By using the function in the answer you could then set the wrapper dimensions based on the dimensions you just calculated.

这篇关于如何将容器包装成经过CSS转换的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆