Boostrap不显示我的表单的背景颜色

时间:2017-03-07 15:56:12

标签: html5 forms twitter-bootstrap css3

我正在使用bootstrap来设计我的表单,但它没有显示表单的背景颜色,就像示例中的那样。

所有字体颜色大小&应用了引导程序的设计,但缺少我的表单背景。

我还复制并粘贴了示例中的所有代码,看它是否会显示表单背景,但即便如此,它也没有显示引导主题的背景颜色。

我在我的html文件中添加了bootstrap.cssbootstrap.min.css

这是我正在使用的主题:https://bootswatch.com/flatly/

HTML代码

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <link rel="stylesheet" href="style.css">
  <link rel="stylesheet" href="bootstrap.css">
  <link rel="stylesheet" href="bootstrap.min.css">
  <title>Users</title>
 </head>
 <body>
  <form class="form-horizontal col-lg-7" style="border: 1px solid red;" action="/index.php">
    <fieldset>
      <div class="form-group">
        <label for="inputUsername" class="col-lg-3 control-label">Username</label>
        <div class="col-lg-3">
          <input type="text" class="form-control" id="inputUsername" placeholder="Enter Username">
        </div>
      </div>

      <div class="form-group">
        <label for="inputPassword" class="col-lg-3 control-label">Password</label>
        <div class="col-lg-3">
          <input type="password" class="form-control" id="inputPassword" placeholder="Password">
        </div>
      </div>
      <div class="form-group">
        <div class="col-lg-10 col-lg-offset-3">
          <button type="reset" class="btn btn-default">Reset </button>
          <button type="submit" class="btn btn-primary">Login </button>
        </div>
      </div>
    </fieldset>
   </form>
  </body>
 </html>

2 个答案:

答案 0 :(得分:0)

尝试这样

&#13;
&#13;
var viewStub = MockRepository.GenerateStub<IView>();
&#13;
&#13;
&#13;

答案 1 :(得分:0)

fiedset标记之前缺少代码:

    <!DOCTYPE html>
    <html>
     <head>
      <meta charset="utf-8">
      <link rel="stylesheet" href="style.css">
       <link rel="stylesheet" href="bootstrap.css">
  <link rel="stylesheet" href="bootstrap.min.css">
  <title>Users</title>
 </head>
 <body>

  <form class="form-horizontal col-lg-7" style="border: 1px solid red;" action="/index.php">
    <div class="row">
          <div class="col-bs-6">
            <div class="well bs-component">
              <form class="form-horizontal">
    <fieldset>
      <div class="form-group">
        <label for="inputUsername" class="col-lg-3 control-label">Username</label>
        <div class="col-lg-3">
          <input type="text" class="form-control" id="inputUsername" placeholder="Enter Username">
        </div>
      </div>

      <div class="form-group">
        <label for="inputPassword" class="col-lg-3 control-label">Password</label>
        <div class="col-lg-3">
          <input type="password" class="form-control" id="inputPassword" placeholder="Password">
        </div>
      </div>
      <div class="form-group">
        <div class="col-lg-10 col-lg-offset-3">
          <button type="reset" class="btn btn-default">Reset </button>
          <button type="submit" class="btn btn-primary">Login </button>
        </div>
      </div>
    </fieldset>
    </div>
    </div>
    </div>
   </form>
  </body>
 </html>