moz变换比例减小div大小问题

发布于 2024-11-15 13:21:31 字数 305 浏览 8 评论 0原文

我在 mozilla moz-transform 缩放属性方面遇到问题。
我正在寻找 Zoom 属性的替代品,它在除 Firefox 之外的所有平台上都能正常工作。

当我想缩小 div 时,它的“内容”确实缩小了,但容器的大小保持不变,在其他内容周围留下了很大的间隙。

有什么方法可以强制容器大小也减小吗?

为了澄清这一点,我在此处放置了一个简单的示例。
在chrome和firefox中打开它,你会看到区别。

I'm having problems with mozilla moz-transform scale property.
I'm looking for a replacement of the zoom property, which works fine in everything except firefox.

When I want to shrink the div, its "content" does shrink, but the size of the container stays the same, leaving a big gap around other content.

Is there any way I can force the container size to decrease as well?

To clarify I put a simple example here.
Open it in chrome and firefox, you will see the difference.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小…楫夜泊 2024-11-22 13:21:31

到目前为止我得到的唯一解决方案是将其全部包装在另一个具有固定高度的 div 容器中。

这并不是我真正想要的,但在有人找到更好的解决方案之前,我认为这是唯一的出路。

The only solution I have got so far is to wrap it all in another div container, with fixed height.

Not really what I was looking for, but until someone finds a better solution, I think its the only way to go.

a√萤火虫的光℡ 2024-11-22 13:21:31

为什么不在 Chrome 中使用 -webkit-transform,而不是混合使用 zoom-moz-transform?然后您可以在所有浏览器上均匀地调整高度。

Instead of mixing zoom and -moz-transform, why not use -webkit-transform for Chrome? Then you can adjust the height equally on all browsers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文