[英]How to use asp.net mvc web form to make button closer to another button?
我有一个工作按钮,它内置在我的视图的表单中,但 UI 看起来不太好,需要 position 中的一些帮助,靠近上传按钮的按钮。 这是我在 View.cshtml 下面的逻辑;
@using (Html.BeginForm("Browse", "Week", FormMethod.Post, new { enctype = "multipart/form-data", @id = "upload" }))
{
@Html.ActionLink("Create New", "Create", routeValues: new { }, htmlAttributes: new { @class = "modal-link btn btn-primary" })
<input type="file" id="fileUpload" name="upload" class="btn-primary" required style="display:none;" />
<label for="fileUpload" id="button" class="btn btn-primary">Upload</label>
<input type="submit" name="extract" class="btn-primary" required style="display:none;" />
}
@using (Html.BeginForm("ExportToExcel", "Week", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div>
<input type="submit" value="Extract" class="btn btn-primary" />
</div>
}
在以下中心执行此操作:
<style>
.closer {
margin-top: 0px;
}
</style>
<input type="submit" class="closer" value="Extract" class="btn btn-primary" />
对内联执行此操作:
@using (Html.BeginForm("Browse", "Week", FormMethod.Post, new { enctype = "multipart/form-data", @id = "upload" }))
{
@Html.ActionLink("Create New", "Create", routeValues: new { }, htmlAttributes: new { @class = "modal-link btn btn-primary" })
<input type="file" id="fileUpload" name="upload" class="btn-primary" required style="display:none;" />
<label for="fileUpload" id="button" class="btn btn-primary">Upload</label>
<input type="submit" name="extract" class="btn-primary" required style="display:none;" />
}
@using (Html.BeginForm("ExportToExcel", "Week", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="submit" value="Extract" class="btn btn-primary" />
}
尝试这个:
@using (Html.BeginForm("Browse", "Week", FormMethod.Post, new { enctype = "multipart/form-data", @id = "upload" }))
{
@Html.ActionLink("Create New", "Create", routeValues: new { }, htmlAttributes: new { @class = "modal-link btn btn-primary" })
<input type="file" id="fileUpload" name="upload" class="btn-primary" required style="display:none;" />
<label for="fileUpload" id="button" class="btn btn-primary">Upload</label>
<input type="submit" name="extract" class="btn-primary" required style="display:none;" />
}
@using (Html.BeginForm("ExportToExcel", "Week", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="submit" value="Extract" class="btn btn-primary" />
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.