CSS剪辑路径定位问题

发布于 2025-02-14 01:03:56 字数 328 浏览 5 评论 0原文

我很难使用剪贴路径属性设置SVG位置。实际上,我有2个SVG文件,star.svg和wave.svg。

我要实现的目标是将恒星相对放置在其HTML母体上,并且以独立的方式将波浪定位在波浪中,例如仅可见恒星的波的部分。

目的是通过自由地翻译和缩放波动而不影响恒星位置(将保持在其初始位置)来使波浪动画,以使波浪仅成为将可见的恒星重叠的一部分。

我通过将Wave.svg插入到我的html上并添加为“ clip-path” CSS属性,并具有“ url(star.svg)”的值,但我无法设法设法将恒星放置在“ url(star.svg)”中。波浪独立。

我会非常感谢您的帮助。 提前致谢。

I'm having difficulties setting SVGs positions with clip-path property. In fact, I have 2 SVG files, star.svg and wave.svg.

What I'm trying to achieve is to position the star relatively to its html parent, and, in an independant manner, position the wave such as only the part of the wave which overlaps the star is visible.

The objective is to animate the wave by translating and scaling it freely without affecting the star position (which will stay at its initial position), in a way that it will only be the part of the wave which overlaps the star which will be visible.

I tried it by integrating the wave.svg inline to my html and adding it the "clip-path" CSS property with a value of "url(star.svg)" but this way I can't manage to position both the star and the wave independently.

I would be so grateful of your help.
Thanks in advance.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文