【问题标题】:link to the card in htmlhtml中卡片的链接
【发布时间】:2023-03-16 11:22:01
【问题描述】:

我需要在文本中添加一个链接href="/favourites_new/",这样当我点击卡片(而不是文本本身)时,我可以转到另一个页面。有我的简单代码

<div class="left-card-parent">
    <div class="left-card">
        <h1 class="left-card-h2"> &#11013;</h1>
            <p>selected</p>
    </div>
</div>

我应该如何解决我的问题?

【问题讨论】:

  • 制作你的卡片&lt;a&gt;标签而不是
    。并把那个href放到那张卡片上。

标签: html css tags href


【解决方案1】:

在标签内添加所有代码 例如

<a href=your link here>
<div class="left-card-parent">
    <div class="left-card">
        <h1 class="left-card-h2"> &#11013;</h1>
            <p>selected</p>
    </div>
</div>
</a>

【讨论】:

    猜你喜欢
    • 2010-10-25
    • 2022-07-20
    • 1970-01-01
    • 2021-03-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-05
    • 1970-01-01
    相关资源
    最近更新 更多