html - Bootstrap 不显示我的表单的背景颜色

标签 html forms twitter-bootstrap css

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

应用了 Bootstrap 的所有字体颜色大小和设计,但我的表单背景丢失了。

我还复制并粘贴了示例中的所有代码,看它是否会显示表单背景,但即便如此,它也没有显示 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>

最佳答案

试试看

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

关于html - Bootstrap 不显示我的表单的背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42652720/

相关文章:

twitter-bootstrap - 在悬停时更改图标栏 Bootstrap 切换菜单

javascript - 如何使用 Sweet Alert 替代标准确认对话框?

javascript - 来自包含的 div 中的意外 jquery 事件行为

javascript - 使用html中的链接调用JS函数

css - :before with an attribute selector

php - 使用 SonataAdminBundle 将多选添加到我的表单作为自定义表单字段

html - 表格中的 Bootstrap 面板 - 偏移量?

ajax - 导航时替换 Bootstrap 输入提示

javascript - 加倍这个修改后的 bootstrap 4 旋转木马只能正确运行一半(滚动循环停止工作)

html - 一个 HTML 上的多个重定向