更换背景颜色:
.navbar {background-color: #febf04;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Twitter Bootstrap Basic Tab Based Navigation Example</title>
<meta name="description"content="Twitter Bootstrap Basic Tab Based Navigation Example">
<link href="../../bootstrap-3.0.0/dist/css/bootstrap.min.css"rel="stylesheet">
<style type="text/css"><!-- 自定义导航条背景 -->
.navbar-w3r{background: #ffd65e; /* Old browsers */background: -moz-linear-gradient(top, #ffd65e 0%, #febf04 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffd65e), color-stop(100%,#febf04)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top, #ffd65e 0%,#febf04 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top, #ffd65e 0%,#febf04 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top, #ffd65e 0%,#febf04 100%); /* IE10+ */background: linear-gradient(to bottom, #ffd65e 0%,#febf04 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffd65e', endColorstr='#febf04',GradientType=0 ); /* IE6-9 */
}
</style>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --><!--[if lt IE 9]><script src="../../bootstrap-3.0.0/assets/js/html5shiv.js"></script><script src="../../bootstrap-3.0.0/assets/js/respond.min.js"></script><![endif]-->
</head>
<body><!-- 导航开始 --><nav class="navbar navbar-fixed-top navbar-w3r" role="navigation"><div class="container"><!-- 项目名称/公司名称 --><div class="navbar-header"><!-- 这个button有什么用? --><button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a class="navbar-brand" href="#">Project Name</a></div><!-- 导航 --><div class="navbar-collapse collapse"><ul class="nav navbar-nav"><li class="active"><a href="#">Home</a></li><li><a href="#about">About</a></li><li><a href="#contact">Contact</a></li><!-- 下拉列表 --><li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Social <b class="caret"></b></a><ul class="dropdown-menu" role="menu"><li><a href="http://www.baidu.com">百度</a></li><li><a href="http://www.sina.com.cn">新浪</a></li><li><a href="http://www.google.com.hk">谷歌</a></li></ul></li></ul><!-- 1个简单的表单 --><form class="navbar-form navbar-right" action="#"><div class="form-group"><input type="text" placeholder="Email" class="form-control"></div><div class="form-group"><input type="password" placeholder="Password" class="form-control"></div><button type="submit" class="btn btn-success">Sign in</button> </form></div><!-- /.navbar-collapse --></div></nav><script src="../../jquery/jquery-1.10.2.min.js"></script><script src="../../bootstrap-3.0.0/dist/js/bootstrap.min.js"></script>
</body>
</html>