mercredi 30 décembre 2020

How can I add a href to an entire figure

I have the following html snippet:

 <figure>
        <img src='image.png' height="250" width="250">
        <figcaption>Album name goes here
            <br>Year goes here
        </figcaption>
</figure>

And the following css:

figure {
    display: inline-block;
    border: 1px;
    margin: 20px; /* adjust as needed */
}
figure img {
    vertical-align: top;
}
figure figcaption {
    border: 1px;
    text-align: center;
}

It would end up looking like this:

enter image description here

How can I set it up so that if a user clicks on the image or the caption under it he gets directed to a new page.




Aucun commentaire:

Enregistrer un commentaire