繁体   English   中英

多层<svg>多边形 - 不工作

[英]Multiple Layers Of <svg> polygons - Not Working

如何在同一个 SVG 中添加多层 SVG 多边形? 例如,我在这里有一张汽车的图(参见片段),如果我想在上面添加一个窗口怎么办? 如果我在汽车标记下方写新的窗口标记(见代码段),它是不可见的。 如果我把它写在上面,汽车标记就会被覆盖。

 <svg heght="100" width="100"> <!--bil--> <polygon points="0,100 0,70 5,65 20,65 30,40 70,40 80,65 95,65 100,70 100,100 90,100 80,90 70,100 30,100 20,90 10,100" style="fill:#777; stroke:#444; stroke-width:3px;"> <!--window--> <polygon points="30,30 50,30 50,50 30,50" style="fill:blue; stroke:#444; stroke-width:3px;"> </svg>

在 SVG 中,您必须使用 /> 或结束标记(例如</polygon>正确终止元素

html 解析器将您当前的标记解析为不允许的嵌套多边形。

您的窗口不在正确的位置,但至少现在它是可见的。

 <svg heght="100" width="100"> <!--bil--> <polygon points="0,100 0,70 5,65 20,65 30,40 70,40 80,65 95,65 100,70 100,100 90,100 80,90 70,100 30,100 20,90 10,100" style="fill:#777; stroke:#444; stroke-width:3px;"/> <!--window--> <polygon points="30,30 50,30 50,50 30,50" style="fill:blue; stroke:#444; stroke-width:3px;"/> </svg>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM