【问题标题】:Adding image to html link attributes将图像添加到 html 链接属性
【发布时间】:2018-08-19 15:22:40
【问题描述】:

我在灯箱中打开了下面的 html 代码,它可以完美地显示标题、图像和页脚。

<a href="example.png" data-footer="The Caption of the Image" data-title="A random title"></a>

我需要在数据标题的位置显示一个徽标。你能帮忙吗?

【问题讨论】:

  • 请创建一个minimal reproducible example - 我们需要查看您创建该灯箱的代码,并请说明您为实现此要求所做的尝试
  • 你好。我试图使用灯箱实现一个图片库。我试图在标题数据标题上放一个徽标。感谢您为此付出的努力。最后我找到了答案。

标签: javascript php html css ajax


【解决方案1】:

我自己找到了答案。如果这对其他人有帮助,请发布。

<a href="example.png" data-footer="The Caption of the Image" data-title="<img src='imgage.png'>"></a>

在上面我将&lt;img&gt; 标签放在数据标题中,就像您链接到图像一样。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-03
    • 1970-01-01
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    • 2012-04-01
    • 1970-01-01
    相关资源
    最近更新 更多