【发布时间】:2019-11-08 12:24:48
【问题描述】:
我已将<img> 包裹在锚标记中,但它不像链接。但是 <p> 充当链接。如何获得它,这样我就不需要<p> 标签,并且图像仍然可以作为同一个链接工作?
当前鼠标悬停在图像上时光标没有变化
<div class="container">
{% for item in page.client_images.all %} {% image item.image fill-150x150-c100 %}
<a href="{{ item.caption }}" style="display:block;">
<img src="{{ img.url }}" class="item" alt="{{ img.alt }}">
<p>{{ item.caption }}</p>
</a>
{% endfor %}
</div>
【问题讨论】:
-
尝试将
display: inline-block或display: block设置为a标签。 -
@Zuber 没用 :(
-
寻求代码帮助的问题必须包含重现它所需的最短代码在问题本身中最好在Stack Snippet 中。见How to create a Minimal, Reproducible Example
-
@Paulie_D 我不知道你还需要什么?