gpt4 book ai didi

css - 如何在页面中心显示用户登录包括所有控件?

转载 作者:行者123 更新时间:2023-11-28 03:28:02 26 4
gpt4 key购买 nike

问题

如何在页面中心显示用户登录信息?

详情

左侧显示用户登录数据

实际上我需要在页面中心显示用户登录数据。

这包括用户名和密码标签以及复选框和标签内存

和用户登录标题和按钮提交以及用户名和密码的文本框

意思是全部移到中心。

@model BookingPrograms.UsersLogin

@{
Layout = null;
}

<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Login</title>
</head>
<body>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryval")


@using (Html.BeginForm())
{
@Html.AntiForgeryToken()

<div class="form-horizontal">
<h4>UsersLogin</h4>
<hr />
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.UserName, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.UserName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.UserName, "", new { @class = "text-danger" })
</div>
</div>



<div class="form-group">
@Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.Password, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
@Html.LabelFor(model => model.Remeber, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
<div class="checkbox">
@Html.EditorFor(model => model.Remeber)
@Html.ValidationMessageFor(model => model.Remeber, "", new { @class = "text-danger" })
</div>
</div>
</div>


<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Login" class="btn btn-default" />
</div>
</div>
</div>
}

<div>
@Html.ActionLink("Back to List", "Index")
</div>
</body>
</html>

最佳答案

使用自定义样式,您可以像这样为表单类设置一些规则来实现此目的。但是请添加并使用不同的类,而不是 Bootstrap 形式水平类。

.form-horizo​​ntal {
边距:0 25px;//margin-top 0 while right and left to 25px
文本对齐:居中;//这使按钮、文本和其余部分居中。
}

试试这个,让我知道你得到了什么。

关于css - 如何在页面中心显示用户登录包括所有控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44876672/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com