Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.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
Html col-md-4和col-md-8赢得';添加一个表单后是否不能浮动?_Html_Css_Twitter Bootstrap - Fatal编程技术网

Html col-md-4和col-md-8赢得';添加一个表单后是否不能浮动?

Html col-md-4和col-md-8赢得';添加一个表单后是否不能浮动?,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,对Bootstrap来说真的很陌生,所以请容忍我。我只是尝试一下,似乎不能让这些保持浮动 我有一个浮动的col-md-4和一个col-md-8,但一旦此表单包含在col-md-4中,col-md-8将停止浮动并被清除 <form class="form-center" role="form"> <div class="form-group"> <div class="input-group">

对Bootstrap来说真的很陌生,所以请容忍我。我只是尝试一下,似乎不能让这些保持浮动

我有一个浮动的
col-md-4
和一个
col-md-8
,但一旦此表单包含在
col-md-4
中,
col-md-8
将停止浮动并被清除

    <form class="form-center" role="form">
       <div class="form-group">
          <div class="input-group"> 
              <span class="input-group-addon">
                  <i class="fa fa-user fa-fw"></i>
              </span>                            
              <input type="text" id="username" name="username" class="form-control" placeholder="Username" />
        </div>
        <div class="form-group">
            <label for="password" class="sr-only">Password</label>
            <div class="input-group"> 
                <span class="input-group-addon">
                    <i class="fa fa-key fa-fw"></i>
                </span>
                <input type="password" id="password" name="password" class="form-control" placeholder="password" />
            </div>  
          <div class="checkbox">
  <label><input type="checkbox" value="">Remember Me</label>
</div>
        </div>
        <button type="submit" class="btn btn-default">Create account</button>
</form>

密码
记得我吗
创建帐户

此外,这里还有一个问题的解决方案。感谢所有的帮助

您需要将div正确地关闭到
col-md-4
,现在
col-md-8
col-md-4
内,因此它不会浮在它旁边

你所拥有的:

<div class="col-md-4">
    <form />
    <div class="col-md-8"></div>
</div>

你应该把它改成什么

<div class="col-md-4">
    <form />
</div>
<div class="col-md-8"></div>


我认为这是一个简单的问题,而不是引导问题,哈哈。我浏览了大量关于col命名约定的文档,认为我把它命名错了。完全忽略了这一点,谢谢!
.col-md-4
上还有额外的结束div标记。我建议使用HTML格式化程序/验证程序或更好的代码编辑器。