【问题标题】:ASP .NET Application - add image instead of text to to asp-route-returnUrlASP .NET 应用程序 - 将图像而不是文本添加到 asp-route-returnUrl
【发布时间】:2021-09-18 07:59:05
【问题描述】:

我想添加一些图片而不是文本。 我该怎么做?

我的例子看起来像:

 <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>

我想在注销文本位置有一个图像。 我想不通。有人可以帮我做这么简单的事情吗..?如何用图像替换按钮?我尝试了很多 img scr 等。但总是有问题而且没有用。

【问题讨论】:

    标签: html css asp.net button


    【解决方案1】:

    有不同的方法可以做到这一点,我更喜欢简单地将图像放入按钮:

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

    见:Embed image in a <button> element

    【讨论】:

      猜你喜欢
      • 2020-06-14
      • 1970-01-01
      • 1970-01-01
      • 2020-08-12
      • 2023-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-04
      相关资源
      最近更新 更多