我正尝试在另一个svg
元素内显示仅带有style
标签的svg
元素,如下所示。
<svg class="root-svg" width="500" height="200">
<svg class="card-background" width="100%" height="100%" style="opacity: 0.79; box-sizing: border-box; border-width: 2px; border-style: solid; border-radius: 15px; background: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSeaeGue0HlHLYRj5wYeUdYO1_geor9C3EvRh-nRzell6MbifcKrg") center center no-repeat;">
</svg>
</svg>
但是svg
内部的内容没有显示。但是,当我仅在svg
内部显示时,它显示为例外。
如何在另一个svg
中显示仅带有style
标签的svg
?
答案 0 :(得分:0)
您是否尝试过为内部svg添加名称空间?
<svg class="root-svg" width="500" height="200" >
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="card-background" width="100%" height="100%" style="opacity: 0.79; box-sizing: border-box; border-width: 2px; border-style: solid; border-radius: 15px; background: url("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSeaeGue0HlHLYRj5wYeUdYO1_geor9C3EvRh-nRzell6MbifcKrg") center center no-repeat;">
</svg>
</svg>