gpt4 book ai didi

html - 如何正确地 元素来加载外部资源?

转载 作者:行者123 更新时间:2023-11-28 16:13:03 26 4
gpt4 key购买 nike

我遵循了很多指南来将外部 SVG 添加到页面...就像这个:http://wearejh.com/design/inline-svg-use-element/

代码是这样的:

<svg>
<use xlink:href="https://upload.wikimedia.org/wikipedia/commons/5/53/Skull_and_crossbones.svg"></use>
</svg>

它只是不加载,示例在这里:http://jsbin.com/cipacitovo/edit?html,output

我做错了什么?

最佳答案

根据 SVG specification

Unlike ‘image’, the ‘use’ element cannot reference entire files.

您需要添加一个 fragment identifier添加到 URL 以指示您要显示的图像中的哪个元素。

关于html - 如何正确地 <use> <svg> 元素来加载外部资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38044215/

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