Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css Asp.NETMVC5+;独自创立如何使输入适应屏幕宽度?_Css_Asp.net_Asp.net Mvc_Twitter Bootstrap_Asp.net Mvc 5 - Fatal编程技术网

Css Asp.NETMVC5+;独自创立如何使输入适应屏幕宽度?

Css Asp.NETMVC5+;独自创立如何使输入适应屏幕宽度?,css,asp.net,asp.net-mvc,twitter-bootstrap,asp.net-mvc-5,Css,Asp.net,Asp.net Mvc,Twitter Bootstrap,Asp.net Mvc 5,我真的不知道我做错了什么。我希望我的文本框与下面的按钮大小相同。我已经在cshtml中尝试了很多更改,但没有成功 下面是我的cshtml文件: @model SomeModel.Models.LoginViewModel <div class="row"> <div class="col-md-8 col-sm-12 col-xs-12"> <section id="loginForm"> @using (H

我真的不知道我做错了什么。我希望我的文本框与下面的按钮大小相同。我已经在cshtml中尝试了很多更改,但没有成功

下面是我的cshtml文件:

@model SomeModel.Models.LoginViewModel

<div class="row">
    <div class="col-md-8 col-sm-12 col-xs-12">
        <section id="loginForm">
            @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
            {
                @Html.AntiForgeryToken()
                <hr />
                @Html.ValidationSummary(true)
                <div class="form-group">
                    @Html.LabelFor(m => m.UserName, new { @class = "col-md-2 control-label" })
                    <div class="col-md-12">
                        @Html.TextBoxFor(m => m.UserName, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.UserName)
                    </div>
                </div>
                <div class="form-group">
                    @Html.LabelFor(m => m.Password, new { @class = "col-md-2 control-label" })
                    <div class="col-md-12">
                        @Html.PasswordFor(m => m.Password, new { @class = "form-control" })
                        @Html.ValidationMessageFor(m => m.Password)
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-12 col-xs-12">
                        <button type="submit" class="btn btn-success btn-block">Entrar</button>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-10 col-sm-12 col-xs-12 visible-sm visible-xs">
                        <button type="submit" class="btn btn-primary btn-block">Ainda Não Tenho Conta</button>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-10 col-sm-12 col-xs-12 visible-sm visible-xs">
                        <button type="submit" class="btn btn-info btn-block">Esqueci Meu Usuário Ou Senha</button>
                    </div>
                </div>
                <p>
                    @Html.ActionLink("Register", "Register") if you don't have a local account.
                </p>
            }
        </section>
    </div>
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
@model SomeModel.Models.LoginViewModel
@使用(Html.BeginForm(“Login”,“Account”,new{ReturnUrl=ViewBag.ReturnUrl},FormMethod.Post,new{@class=“form horizontal”,role=“form”}))
{
@Html.AntiForgeryToken()

@Html.ValidationSummary(true) @LabelFor(m=>m.UserName,新的{@class=“col-md-2控制标签”}) @TextBoxFor(m=>m.UserName,新的{@class=“form control”}) @Html.ValidationMessageFor(m=>m.UserName) @LabelFor(m=>m.Password,新的{@class=“col-md-2控制标签”}) @Html.PasswordFor(m=>m.Password,新的{@class=“form control”}) @Html.ValidationMessageFor(m=>m.Password) 诱捕者 安达Não Tenho Conta 埃斯奎奇·梅奥·乌苏拉里奥·奥塞尼亚(Esqueci Meu Usuário Ou Senha) @ActionLink(“注册”、“注册”),如果您没有本地帐户。

} @节脚本{ @Scripts.Render(“~/bundles/jqueryval”) }

我做错了什么?

默认MVC5模板在Site.css中有一个css规则:

我通常删除这个规则


这会导致Bootstrap v3输入组出现问题,其中输入框未扩展到其容器的宽度。

默认site.css定义了限制宽度的规则。我回答了一个类似的问题你是对的。我一个人永远也找不到这个。谢谢:)。PS:将此作为答案发布。我是在Chrome的开发工具中找到的。我检查了元素,它显示了附加了哪些css规则以及这些规则定义了哪些文件。但是,是的,这也让我困惑了一段时间。
input, select, textarea { max-width: 280px; }