我似乎无法更改导航栏中的字体颜色,导航栏css中的其他元素可以使用,但出于某种原因不能使用字体颜色。我试图改变这个类,但是接下来我的其他元素不能工作。我似乎无法找到问题,虽然这是我第一次使用bootstrap。不能更改导航栏中的字体颜色
CSS
.navbar {
background-color: white;
border: none;
color: #0000;
}
.navbar-brand {
font-size: 50px;
}
HTML
<head>
<title></title>
<meta charset="utf=8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
</head>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar=header">
<a class="navbar-brand" href="#">TRAVELLING</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">home</a></li>
<li><a href="#">about</a></li>
<li><a href="#">contact</a></li>
</ul>
</div>
</div>
</nav>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js">
</script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js">
</script>
</body>
</html>
'颜色:#0000;'==>'颜色:#000;' –
我同意@AlonEitan你也可以使用'color:#000 important!'来强制效果。 – Rahel
我明白你的意思,但仍然没有为我工作,使用重要!,仍然没有工作。我试着把红色仍然没有改变字体颜色。 – user3444694