mvc 5 @html.editorfor class 不适合父宽度
mvc 5 @html.editorfor class do not fit parent width
我正在做一个 MVC 5 应用程序。在我看来,我在 <div>
中有一个 @html.editorfor
不符合我想要的方式。
这是我的查看代码。
<div class="DvCampoAct" style="border:1px solid black">
@Html.EditorFor(model => model.user.Email, new { htmlAttributes = new {@class = "StyleOb", @onclick = "ocultar();", placeholder = "Insert you Email." } })
</div>
我的divDvCampoAct
的class是这样的。我添加了一个黑色边框来显示 div 的宽度。
.DvCampoAct{
float:left;
width:75%;
padding-bottom:5px;
}
当时EditFor
的Style(StyleOB)是这样的
.StyleOb
{
height:30px;
width:100%;
padding:2px 0 0 2px;
border:1px solid #BEBEBE;
background-color:#F0F8FF;
}
它的样子是这样的。
它显示父 Div 是黑色的...并且 EditFor 的宽度不适合 div 父宽度。它似乎是 80%。
我的问题是为什么我的 EditFor
不适合父 div
的 100%?
搜索 max-width 的解决方案:我的内容文件夹中有一个 CSS 文件,其中 max-width 用于输入、选择和 280 像素的文本区域.
也许你也能找到:
Project/Content/Site.css
input,
select,
textarea {
max-width: 280px;
}
我正在做一个 MVC 5 应用程序。在我看来,我在 <div>
中有一个 @html.editorfor
不符合我想要的方式。
这是我的查看代码。
<div class="DvCampoAct" style="border:1px solid black">
@Html.EditorFor(model => model.user.Email, new { htmlAttributes = new {@class = "StyleOb", @onclick = "ocultar();", placeholder = "Insert you Email." } })
</div>
我的divDvCampoAct
的class是这样的。我添加了一个黑色边框来显示 div 的宽度。
.DvCampoAct{
float:left;
width:75%;
padding-bottom:5px;
}
当时EditFor
的Style(StyleOB)是这样的
.StyleOb
{
height:30px;
width:100%;
padding:2px 0 0 2px;
border:1px solid #BEBEBE;
background-color:#F0F8FF;
}
它的样子是这样的。
它显示父 Div 是黑色的...并且 EditFor 的宽度不适合 div 父宽度。它似乎是 80%。
我的问题是为什么我的 EditFor
不适合父 div
的 100%?
搜索 max-width 的解决方案:我的内容文件夹中有一个 CSS 文件,其中 max-width 用于输入、选择和 280 像素的文本区域.
也许你也能找到:
Project/Content/Site.css
input,
select,
textarea {
max-width: 280px;
}