leo*_*ora 19 asp.net-mvc textbox
如何在asp.net-mvc视图中更改文本框的宽度
我希望将这些字段并排放置,并且状态文本框的宽度要短得多
<p>
<label for="city">City:</label>
<%= Html.TextBox("city")%>
<label for="state">State:</label>
<%= Html.TextBox("state")%>
</p>
Run Code Online (Sandbox Code Playgroud)
编辑:
以下答案似乎都不适合我.我注意到在site.css中我看到了这个:
fieldset p
{
margin: 2px 12px 10px 10px;
}
fieldset label
{
display: block;
}
fieldset label.inline
{
display: inline;
}
legend
{
font-size: 1.1em;
font-weight: 600;
padding: 2px 4px 8px 4px;
}
input[type="text"]
{
width: 200px;
border: 1px solid #CCC;
}
input[type="password"]
{
width: 200px;
border: 1px solid #CCC;
}
Run Code Online (Sandbox Code Playgroud)
我如何覆盖一个字段(文本框)的此行为
tva*_*son 32
我会使用带有HTML属性的helper签名并为其分配一个CSS类.然后,您将使用CSS来实现所需的外观.
<%= Html.TextBox( "state", null, new { @class = "small-input" } ) %>
Run Code Online (Sandbox Code Playgroud)
Jef*_*mer 21
<%= Html.TextBox("state", null, new { @style = "width: 300px;" })%>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
62611 次 |
最近记录: |