Having an issue with hover in CSS. Attempting to create a menu bar using saved PNG files, each file within its own div. When applying a class name and hover modifier, it only works on the first element. As the pointer moves to subsequent elements, they are all highlighted simultaneously. How can I resolve this problem?
Appreciate any help provided.
Code snippet:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content Type' content="text/html ; charset=UTF-8">
<title>Awantura Sluzewiec</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0 /jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4 /jquery-ui.min.js"></script>
<script type="text/javascript"></script>
<style type="text/css">
body {
background: black url('images/background.png') top left no-repeat;
background-size: cover;
}
header {
background: url('images/logo_tittle.png') top left no-repeat;
position: relative;
top: 25px;
left: 25px;
width: 1215px;
height: 157px;
}
nav {
position: absolute;
top: 50%;
margin-top: -180px;
left: 73px;
width: 1073px;
height: 40px;
}
.navButtons {
display: block;
left: 145px;
position: relative;
width: 149px;
height: 40px;
background-size: cover;
}
.navButtons:hover {
box-shadow: 0 0 10px white;
}
#O_nas {
background: transparent url('images/o_nas.png') center center no-repeat;
}
#Druzyna {
background: transparent url('images/druzyna.png') center center no-repeat;
}
#Treningi {
background: transparent url('images/treningi.png') center center no-repeat;
}
#Obiekt {
background: transparent url('images/obiekt.png')center center no-repeat;
}
#Wyniki {
background: transparent url('images/wyniki.png') center center no-repeat;
}
#Trener {
background: transparent url('images/trener.png') center center no-repeat;
}
#Promil {
background: transparent url('images/promil.png') center center no-repeat;
}
</style>
</head>
<body>
<header></header>
<div></div>
<nav>
<div id="O_nas" class="navButtons" </div>
<div id="Druzyna" class="navButtons" </div>
<div id="Treningi" class="navButtons" </div>
<div id="Obiekt" class="navButtons" </div>
<div id="Wyniki" class="navButtons" </div>
<div id="Trener" class="navButtons" </div>
<div id="Promil" class="navButtons" </div>
</nav>
</body>
</html>