I am having hard time to understand why underline is shrinking at the end of hovering state (small vertical shrink). Code itself is simple and there shouldn't be anything that shrinks this pseudo element. The same thing is happening in this editor. But, this effect isn't happening on Mozilla for example. So my question is: Am I missing something or is this something Google chrome has with?
a{
text-decoration: none;
}
.header{
z-index: 1;
height: 100px;
width: 100%;
position: absolute;
}
.main-header{
background-color: var(--menu-header-background);
top: var(--header_height);
text-shadow: 0 2px 5px rgba(0, 0, 0, .2);
}
.small-header{
height: var(--header_height);
background-color: rgba(0, 0, 0, 0.63);
}
li{
list-style-type: none;
}
.header-container{
max-width: 1100px;
margin: auto;
height: inherit;
}
.navigation{
float: right;
height: inherit;
}
.navigation{
float: right;
height: inherit;
}
header .navigation a li{
display: table-cell;
vertical-align: middle;
color: black;
text-transform: uppercase;
height: inherit;
}
#main-menu li:hover{
color: blue;
transition: .4s;
}
#main-menu a{
position: relative;
}
#main-menu li::after{
content: '';
position: absolute;
left: 50%;
bottom: 0px;
transform: translateX(-50%) scaleX(0);
width: 100%;
height: 2px;
background-color: blue;
transition: transform .25s;
}
#main-menu li:hover::after{
transform: translateX(-50%) scaleX(1);
}
<header class="main-header header">
<div class="header-container">
<ul class="navigation" id="main-menu">
<a href="#">
<li>home</li>
</a>
<a href="#">
<li>about me</li>
</a>
<a href="#">
<li>projects</li>
</a>
<a href="#">
<li>contact me</li>
</a>
</ul>
</div>
</header>