小编jos*_*pj1的帖子

Bootstrap 导航栏背景颜色没有改变

我正在为我的网站使用引导程序导航栏。如果我想更改导航栏的背景颜色,我可以使用:

<!-- Navbar -->
<nav class="navbar navbar-default" role="navigation" >

    <div class="container-fluid" style="background-color:#000000">

       <p>hi</p>

    </div>

</nav>
Run Code Online (Sandbox Code Playgroud)

但是,如果我尝试在外部工作表中使用 css 使用

.nav_backcolor {
   background-color:#000000;
}
Run Code Online (Sandbox Code Playgroud)

或使用覆盖样式表中的引导程序类

.navbar-default {

background-color:#000000;

}
Run Code Online (Sandbox Code Playgroud)

并添加类

<!-- Navbar -->
<nav class="navbar navbar-default nav_backcolor" role="navigation" >

<div class="container-fluid">

   <p>hi</p>

</div>

</nav>
Run Code Online (Sandbox Code Playgroud)

它不起作用。请问有什么帮助吗?

html css twitter-bootstrap

2
推荐指数
1
解决办法
9702
查看次数

标签 统计

css ×1

html ×1

twitter-bootstrap ×1