gpt4 book ai didi

html - SVG 曲线的负

转载 作者:太空宇宙 更新时间:2023-11-04 03:37:33 25 4
gpt4 key购买 nike

我花了很多时间来创建这条 svg/path 曲线的负片。

我想要的是 <path> 描述的填充部分的白色, 蓝色对后面的元素透明 - 与当前描述正好相反。

非常感谢任何想法!

http://jsfiddle.net/CG_Pilot/0nw862zf/6/

<svg class="curveDownColor curveDown" xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="50" viewBox="0 0 100 100" preserveAspectRatio="none">
<path d="M0 0 C 50 100 80 100 100 0 Z"></path>
</svg>

使用这个 CSS:

.curveDownColor {
fill: blue;
stroke: yellow;
stroke-width: 3px;
border: 2px dashed green;
}

http://jsfiddle.net/CG_Pilot/0nw862zf/2/embedded/result/

最佳答案

所以,像这样? http://jsfiddle.net/0nw862zf/8

我所做的只是将框边界添加到此处的路径。因此,不要在路径的末尾使用 Z,而是让路径遵循 L 100 100, L 0 100 的边界,then Z

enter image description here

关于html - SVG 曲线的负 <Path>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25345502/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com