我有下面的 html 代码,它在灯箱中打开,它完美地工作,显示了标题、图像和页脚。
<a href="example.png" data-footer="The Caption of the Image" data-title="A random title"></a>
我需要在数据标题的地方显示一个标志。你能帮忙吗?
最佳答案
我自己找到了答案。如果这对其他人有帮助,请发布。
<a href="example.png" data-footer="The Caption of the Image" data-title="<img src='imgage.png'>"></a>
我在上面放置了 <img>
就像链接到图像一样,在数据标题中添加标签。
关于javascript - 将图像添加到 html 链接属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51919123/