Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚开始使用 WebMatrix,想知道如何设置样式@Html.TextBox("email")和@Html.Password("password")控制?
@Html.TextBox("email")
@Html.Password("password")
我试过(在我的 CSS 文件中):
.email{ /* styles here */ } .password{ /* styles here */ }
但这根本没有效果。我们如何设计这些类型的控件?
您可以在创建具有匿名类型的文本框时指定要使用的类,如下所示:@Html.TextBox("Email", null, new { @class="email" })
@Html.TextBox("Email", null, new { @class="email" })