html - 无论我尝试什么,将 CSS 与 Bootstrap 一起使用都行不通

标签 html css twitter-bootstrap

我正在使用 Bootstrap 库来创建我的网站,我想使用 CSS 来修改部分布局,例如背景颜色和超大屏幕的颜色,但没有任何方法可以使它起作用。
如何将 CSS 与 Bootstrap 一起使用。

.jumbotron 
    {
        background-color:red !important; 
    }

    #body
    {
        background-color:black;
    }


<body>
  <div class="body">
    <div class="jumbotron">
      <div class="container text-center">
        <p>"Quote goes here"</p>
        <h1>Site name</h1>
        <p>Motto and slogan goes here</p>
      </div>
    </div>
  </div>
</body>

谢谢

最佳答案

你有没有把你的CSS包裹在样式标签中?

<style type="text/css">
 .jumbotron 
    {
        background-color:red !important; 
    }

body
    {
        background-color:black;
    }
</style>
<body>
  <div class="body">
    <div class="jumbotron">
      <div class="container text-center">
        <p>"Quote goes here"</p>
        <h1>Site name</h1>
        <p>Motto and slogan goes here</p>
      </div>
    </div>
  </div>
</body>

results

关于html - 无论我尝试什么,将 CSS 与 Bootstrap 一起使用都行不通,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38552522/

相关文章:

html - 如何在我的 web.config 中包含我的 CSS 文件的路径?

javascript - 折叠的导航栏下拉时如何更改背景颜色?

javascript - Bootstrap Flash 警报 CSS 在移动屏幕上无法正常工作

html - 如何删除选择元素中的自动调整大小

html - 如何使用 Dart :html library to write html files?

html - 去html模板表

html - CSS3 : Multiple rotated divs vertically aligned

javascript - 用于桌面和移动平台的 Twitter bootstrap popover 触发器

html - 线性渐变叠加在 IE 中不起作用

html - 有没有办法将不同高度的图像放入 HTML/CSS 中的 3 列中?