【问题标题】:Style a submit input to look like a span with bootstrap glyphicon styling using MVC使用 MVC 使用引导 glyphicon 样式设置提交输入的样式,使其看起来像一个跨度
【发布时间】:2016-06-08 02:42:34
【问题描述】:

我有一个跨度链接,它使用引导类来显示垃圾图标。所有这些都在 MVC 中

所以:

<a href=@Url.Action("Delete", "Site", new { siteID = Model.SiteId, clientID = Model.ClientID }) >
    <span class="glyphicon glyphicon-trash" />
</a>

我现在有一个输入,我想以相同的方式设置样式,但带有一个打印图标。输入是提交输入,我希望表单与在另一个输入中选择的文件一起回发。全部封装在一个表单中。

这是我的代码:

@using (Html.BeginForm("Print", "Site", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <input name="file" type="file">

    <input type="submit" value="OK" onclick="javascript: form.action='@Url.Action("Print", new { clientID = Model.ClientID, siteID = Model.SiteID })' " />
}

我希望输入看起来像是一个带有引导样式的跨度,所以我希望它看起来像这样:

<span class="glyphicon glyphicon-print" />

谁能帮忙。

谢谢

【问题讨论】:

    标签: asp.net-mvc css twitter-bootstrap-3 form-submit


    【解决方案1】:

    将输入类型更改为按钮

    <button type="submit" onclick="some action"><span class="fa fa-area-chart"></span></button>
    

    这是你可以在按钮之间添加跨度

    【讨论】:

    • 差不多,不希望按钮“样式”我只想显示打印图标。
    • 已排序。我添加了一些样式,现在看起来很好。谢谢
    猜你喜欢
    • 1970-01-01
    • 2014-02-10
    • 2013-09-25
    • 1970-01-01
    • 2013-08-19
    • 2014-10-01
    • 2023-03-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多