0

I would like to add some picture to route instead of text. How can I do that?

My example looks like :

 <form id="logoutForm" class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="@Url.Action("Index", "Home", new { area = "" })">
        <button id="logout" type="submit" class="nav-link btn btn-link text-white">Logout</button>
    </form>

I want to have an image in Logout text place. I can't figure it out. Can someone help me with that simple thing.. ? How can I replace button with an image? I try a lot of img scr etc. But always something is wrong and it didn't works.

Selim Yildiz
  • 5,254
  • 6
  • 18
  • 28
Adam Zbudniewek
  • 107
  • 2
  • 12

1 Answers1

1

There are different ways to do that, I prefer simply put an image into a button:

<button id="logout" type="submit" class="nav-link btn btn-link text-white">
    <img src="logout_button.png">
</button>

See: Embed image in a <button> element

Selim Yildiz
  • 5,254
  • 6
  • 18
  • 28