缩放元素及其内容——CSS3 缩放属性的替代方案?

发布于 2024-07-05 09:36:02 字数 331 浏览 5 评论 0原文

是否有跨浏览器方法来模拟 CSS3 的缩放属性? 我知道如何分别缩放图像和文本,但似乎无法保持所有内容对齐。

一种解决方案可能是读取元素及其子元素的计算样式,将所有度量转换为 px,将它们乘以某个因子,然后使用这些新样式生成 HTML/CSS。 另一种解决方案实际上可能有意义。 :)

重要提示:正确的解决方案不对它所作用的页面进行任何假设。 我们不知道每个元素的大小都以 px 为单位,由外部样式表设置样式,或者其他任何内容。

谢谢!

Is there a cross-browser method to emulate CSS3's zoom property? I know how to zoom images and text separately, but cannot seem to keep everything aligned.

One solution might be to read the computed styles of the element and its children, convert all measures to px, multiply them by some factor, and then generate HTML/CSS with these new styles. Another solution might actually make sense. :)

Important: A correct solution assumes nothing about the page it acts on. We don't know that every element is sized in px, styled by an external stylesheet, or anything else.

Thanks!

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

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

发布评论

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

评论(1

无法言说的痛 2024-07-12 09:36:02

您可以尝试使用提供Effect.Scale 功能。

You could try using the Scriptaculous library that provides Effect.Scale functionality.

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