0
我正在創建一個登錄表單,並且遇到CSS無法處理密碼輸入控件和提交按鈕的問題。我使用的是Bootstrap 3.0,我的代碼如下。所有其他表單控件都以正確的樣式顯示。在ASP.NET中不顯示密碼輸入的CSS樣式
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
@Html.ValidationSummary(true, "", new { @class = "text-danger" })
<div class="form-group">
@Html.LabelFor(model => model.UserName, htmlAttributes: new { @class = "control-label" })
@Html.EditorFor(model => model.UserName, new { htmlAttributes = new { @class = "form-control" } })
@Html.ValidationMessageFor(model => model.UserName, "", new { @class = "text-danger" })
</div>
<div class="form-group">
@Html.LabelFor(model => model.Password, htmlAttributes: new { @class = "control-label" })
@Html.PasswordFor(model => model.Password, new { htmlAttributes = new { @class = "form-control", placeholder = "Password" } })
@Html.ValidationMessageFor(model => model.Password, "", new { @class = "text-danger" })
</div>
<div class="form-group">
<input type="submit" value="Login" class="btn btn-primary" />
</div>
</div>
}
下面是它是如何顯示的圖像:
密碼輸入應該看起來一樣的用戶名的輸入,以及按鈕應該是相同的寬度與上述輸入它。
不客氣!很高興我能幫上忙 ;) – Shyju