2
I started learning bootstrap today and made a very simple test site. It has a navbar with some links. The point is that I can not change the color in the links when passing the mouse in any way, only with the default interaction (darken when passing the mouse). If anyone can help me, I’d be grateful, follow the code
HTML
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!--Bootstrap-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<!--Fonts-->
<link href="https://fonts.googleapis.com/css?family=Poppins" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Staatliches" rel="stylesheet">
<!--Stylesheet-->
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>Teste</title>
</head>
<body>
<nav class="navbar navbar-default">
<div id="navbar" class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">Teste</a>
</div>
<ul class="nav navbar-nav">
<li><a href="#indicadores">Indicadores</a></li>
<li><a href="#aprendizagem">Aprendizagem</a></li>
<li><a href="#graficos">Gráficos</a></li>
<li><a href="#simulador">Simulador</a></li>
<li><a href="#carteira">Carteira</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Registrar-se</a></li>
<li><a href="#">Entrar</a></li>
</ul>
</div>
</nav>
<div class="container">
<h3>Exemplo</h3>
<p>Testando a página em Bootstrap</p>
</div>
</body>
</html>
CSS
body {
font-family: "Poppins";
margin: 0px;
}
/*----------Navbar----------*/
.container-fluid a:hover{
color: rgb(26, 244, 183);
}
#navbar {
background-color: rgb(46,41,58);
margin: 0px;
}
.navbar, .navbar-default {
border: none;
}
nav a:hover {
color: aqua;
}
.navbar-nav {
color: aqua;
}
We have a solution for this at Stackoverflow.com: https://stackoverflow.com/questions/16625972/change-color-of-bootstrap-navbar-on-hover-link
– Getulio Rafael Ferreira
I just had to put in a statement !Important in Hover staying like this:
nav a:hover { color: aqua !important; }
– LeAndrade