相关疑难解决方法(0)

如何在svg元素中使用z-index?

我在我的项目中使用svg圈子,

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 120">
    <g>
        <g id="one">
            <circle fill="green" cx="100" cy="105" r="20" />
        </g>
        <g id="two">
            <circle fill="orange" cx="100" cy="95" r="20" />
        </g>
    </g>
</svg>
Run Code Online (Sandbox Code Playgroud)

我在g标签中使用z-index 来显示第一个元素.在我的项目中,我只需要使用z-index值,但我不能将z-index用于我的svg元素.我google了很多,但我找不到任何相对的东西.所以请帮我在我的svg中使用z-index.

这是DEMO.

javascript jquery svg z-index

140
推荐指数
11
解决办法
18万
查看次数

标签 统计

javascript ×1

jquery ×1

svg ×1

z-index ×1