2

Using Thymeleaf, how can I make an image act as a hyperlink?

The Thymeleaf Documentation says nothing about images and I tried using standard HTML for this issue but none of the below attempts made my image an active hyperlink.

<a th:href="@{/user/myUser}">
    <img src="../../static/images/image.jpg" alt="logo"/>
</a>

<a href="https://www.w3schools.com">
    <img src="../../static/images/image.jpg" alt="logo"/>
</a>
ceid-vg
  • 323
  • 2
  • 9
  • 21

1 Answers1

2
        <a href="/oauth2/authorization/google">
            <img alt="Google Login" title="Google login"
                th:src="@{/images/login-with-google.png}" />
        </a>
Obinna Kalu
  • 708
  • 8
  • 12