Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.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/30.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 引导-输入组不工作_Css_Asp.net_Twitter Bootstrap 3_Visual Studio 2015 - Fatal编程技术网

Css 引导-输入组不工作

Css 引导-输入组不工作,css,asp.net,twitter-bootstrap-3,visual-studio-2015,Css,Asp.net,Twitter Bootstrap 3,Visual Studio 2015,我正在尝试使用.input组类对齐输入和按钮,如图所示 当我在文本框前放置一个按钮时,它工作良好并显示所需的输出 但是,当我将按钮放在文本框旁边时,按钮不会靠近文本框 我在ASP.NET项目中使用Bootstrap 3,该项目是使用Visual Studio 2015社区版创建的 代码如下: <div class="row"> <div class="col-lg-6"> <div class="input-group"> <sp

我正在尝试使用.input组类对齐输入和按钮,如图所示

当我在文本框前放置一个按钮时,它工作良好并显示所需的输出

但是,当我将按钮放在文本框旁边时,按钮不会靠近文本框

我在ASP.NET项目中使用Bootstrap 3,该项目是使用Visual Studio 2015社区版创建的

代码如下:

<div class="row">
  <div class="col-lg-6">
    <div class="input-group">
      <span class="input-group-btn">
        <button class="btn btn-default" type="button">Go!</button>
      </span>
      <input type="text" class="form-control" placeholder="Search for...">
    </div><!-- /input-group -->
  </div><!-- /.col-lg-6 -->
  <div class="col-lg-6">
    <div class="input-group">
      <input type="text" class="form-control" placeholder="Search for...">
      <span class="input-group-btn">
        <button class="btn btn-default" type="button">Go!</button>
      </span>
    </div><!-- /input-group -->
  </div><!-- /.col-lg-6 -->
</div><!-- /.row -->

我也有同样的问题,我看了看cale_b的小提琴,它对我来说似乎是正确的。所以我挠头想弄清楚我的环境有什么不同。我注意到,在我的site.css中,我为我的应用程序定制了以下css:

/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
    max-width: 280px;
}

一旦我删除或注释掉了CSS,它就工作了。但是现在我需要找到一种不同的方法来默认输入的最大宽度。哦,好吧,至少它解决了我的问题,希望它解决了你的问题。

我遇到了完全相同的问题,我看着cale_b的小提琴,它对我来说似乎是正确的。所以我挠头想弄清楚我的环境有什么不同。我注意到,在我的site.css中,我为我的应用程序定制了以下css:

/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
    max-width: 280px;
}

一旦我删除或注释掉了CSS,它就工作了。但是现在我需要找到一种不同的方法来默认输入的最大宽度。哦,好吧,至少它解决了我的问题,希望它解决了你的问题。

这不是我的经验,佩尔。你能在浏览器上分享更多吗?版本实际呈现的标记与编码的标记?如果您使用MVC或webforms,您可以发布呈现的输出吗?根据我的经验,这不是我的经验。你能在浏览器上分享更多吗?版本实际呈现的标记与编码的标记?如果您使用的是MVC或webforms,您可以发布呈现的输出吗?这对我也很有用。Asp.NETMVC在内容文件夹中添加了一个默认的Site.css,并没有css标记。总是很容易忘记,即使是空的MVC模板的样式也会覆盖引导cssWorked。Net MVC在内容文件夹中添加一个默认的Site.css作为css标记。总是很容易忘记,即使是空的MVC模板的样式也可以覆盖引导css