我想編輯我的bootstrap導航欄的樣式。但是,例如,我無法編輯顏色和刪除邊框。我想只是將顏色更改爲白色,並將邊框顏色更改爲白色,以及下面的代碼。誰能告訴我我做錯了什麼?如何編輯引導程序導航欄的樣式?
.navbar-default {
background-color: #ffffff;
border-color: #ffffff;
}
.navbar-default .navbar-brand {
color: #292929;
}
.navbar-default .navbar-brand:hover,
.navbar-default .navbar-brand:focus {
color: #ffd4d4;
}
.navbar-default .navbar-text {
color: #292929;
}
.navbar-default .navbar-nav > li > a {
color: #292929;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
color: #ffd4d4;
}
.navbar-default .navbar-nav > .active > a,
.navbar-default .navbar-nav > .active > a:hover,
.navbar-default .navbar-nav > .active > a:focus {
color: #ffd4d4;
background-color: #ffffff;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
color: #ffd4d4;
background-color: #ffffff;
}
.navbar-default .navbar-toggle {
border-color: #ffffff;
}
.navbar-default .navbar-toggle:hover,
.navbar-default .navbar-toggle:focus {
background-color: #ffffff;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: #292929;
}
.navbar-default .navbar-collapse,
.navbar-default .navbar-form {
border-color: #292929;
}
.navbar-default .navbar-link {
color: #292929;
}
.navbar-default .navbar-link:hover {
color: #ffd4d4;
}
.navbar-brand {
transform: translateX(-50%);
left: 50%;
position: absolute;
}
.navbar-nav > li.navbar-left {
font-family: 'Nunito Sans', sans-serif;
font-size: 11px;
}
.navbar-brand {
padding: 0px;
}
.navbar-brand>img {
height: 90%;
width: auto;
}
.banner {
\t width: 100%;
\t /*background-color: #c3d7df;*/
}
.banner-inner {
\t max-width: 1100px;
\t margin: 0 auto;
}
<!DOCTYPE html>
<html lang="en">
<head>
\t <meta charset="utf-8"/>
\t <meta name="viewport" content="width=device=width, initial-scale=1.0">
\t <title> My Website</title>
\t <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
\t <link rel="stylesheet" type="text/css" href="style.css" />
\t <link href="https://fonts.googleapis.com/css?family=Nunito|Nunito+Sans|Playfair+Display" rel="stylesheet">
\t <!-- Latest compiled and minified CSS -->
\t <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
\t <!-- Latest compiled and minified JavaScript -->
\t <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
\t </head>
<body>
\t <header>
\t \t <div class="container">
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://jh.com"><img class= "logo" src="img/logo.png"></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="navbar-left"><a href="index.html">TRAVEL</a></li>
\t \t <li class="navbar-left"><a href="#"> INSPIRATION</a></li>
\t \t <li class="navbar-left"><a href="#"> PORTFOLIO </a></li>
\t \t <li class="navbar-left"><a href="#"> ABOUT </a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
\t \t <li> <a href="https://www.instagram.com"><i class="fa fa-instagram"></i></a>
\t \t <li> <a href="https://www.pinterest.com"><i class="fa fa-pinterest"></i></a>
\t \t <li> <a href="https://www.facebook.com"><i class="fa fa-facebook"></i></a>
\t \t <li> <a href="https://twitter.com"><i class="fa fa-twitter"></i></a>
\t \t \t \t
\t \t \t \t
</ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container-fluid -->
</nav>
</div>
\t </header>
<!---End Header-->
\t <section class="banner">
\t \t <div class="banner-inner">
\t \t \t <img class="banner" src="img/background.png">
\t \t </div>
\t </section>
<!---End Banner-->
</body>
</html>
不要創建具有相同名稱的CSS。創建一些新的類並添加到引導欄中。 –
如果您使用相同的名稱,請使用!重要的CSS屬性。 –