Occasionally, a tiny dot appears almost imperceptibly, like the one below the "prices" menu item:
https://i.stack.imgur.com/kyaP3.png
This is the hover effect code I created:
:root {
box-sizing: border-box;
}
*,
*::before,
*::after {
box-sizing: inherit;
}
body {
margin: 0;
padding: 0;
}
.navbar {
display: flex;
list-style: none;
padding: 0;
margin: 0;
}
.navbar > li + li {
margin-left: 1.5em;
}
.navbar > li > a {
display: block;
padding: .5em 0 .05em;
color: #0e9daf;
font-size: 2rem;
text-decoration: none;
position: relative;
}
.navbar > li > a::after {
content: "";
display: block;
position: absolute;
left: 50%;
right: 50%;
bottom: 0;
height: 2px;
background: currentColor;
transition:
left .4s ease-out,
right .4s ease-out;
}
.navbar > li > a.active::after,
.navbar > li > a:hover::after {
left: 0;
right: 0;
}
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="menu-slide-center.css">
<title>Menu Slide from Center Effect</title>
</head>
<body>
<nav>
<ul class="navbar">
<li><a href="#" class="active">Home</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Prices</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
</body>
</html>
I've observed the same issue in Chrome and Firefox as well. Any suggestions on how to resolve it?