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