-2
I’m using the pseudo-class :hover
to change the style of an element <li>
, when I move the mouse over. The background-color
works, but the color of the text does not. I have no idea why. It follows below my html:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Desafio Menu</title>
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<style>
header {
background-color: #060012;
}
a {
font-family: Arial, Helvetica, sans-serif;
font-weight: 900;
color: #ffffff
}
.autenticacao {
position: absolute;
width: 150px;
right: 5px;
top: 40px;
float: right;
/* padding-right: 50px; */
box-sizing: border-box;
clear: both;
}
nav {
position: absolute;
/* float: left; */
left: 330px;
top: 30px;
/* padding: 10px 20px; */
}
li {
position: relative;
margin: 5px;
float: left;
list-style-type: none;
}
li:hover {
background-color:lightseagreen;
color: #000;
}
.logo {
position: relative;
top: 5px;
bottom: 5px;
left: 10px;
width: 310px;
height: 70px;
}
#logo {
max-width: 300px;
max-height: 90px;
width: auto;
height: auto;
}
.menu-toggle {
position: absolute;
right: 5px;
top: 5px;
display: none;
clear: right;
}
</style>
</head>
<body>
<header class="cabecalho">
<div class="logo">
<a href="#inicio">
<img id="logo" src="http://files.cod3r.com.br/curso-web/logo.png" alt="Logo" />
</a>
</div>
<button class="menu-toggle">
<i class="fa fa-lg fa-bars"></i>
</button>
<nav class="menu">
<ul>
<li>
<a href="#inicio">Início</a>
</li>
<li>
<a href="#cursos">Cursos</a>
</li>
<li>
<a href="#sobre">Sobre</a>
</li>
<li>
<a href="#contato">Contato</a>
</li>
</ul>
</nav>
<aside class="autenticacao">
<a href="#login">Login</a>
<a href="#registar" class="botao destaque">Registrar</a>
</aside>
</header>
<script>
</script>
</body>
</html>