There's a very strange problem that i am facing in a webpage that i am designing. It's plain HTML and CSS and i am trying to create an animation at the bottom of each anchor element. All are of equal width of 25% since i am using a grid system but the lines underneath the anchor elements are showing a strange behavior where some of the lines are smaller in height than the others even though i've given equal height to all the anchor elements. A fixed height of lets say 3px works perfectly fine when given to the before element. It's the 5% value that's causing this and i have no idea why.
The screenshot of what's happening with the a elements
.three-columns
{
width: 25%;
}
a.listings
{
font-family: "Consolas", 'Roboto', 'Open Sans', sans-serif;
text-decoration: none;
display: inline-block;
height: 100%;
padding: 2.5%;
margin-bottom: 5%;
transition: color 0.5s 0s;
position: relative;
}
a.listings::before
{
content: '';
position: absolute;
background: green;
height: 5%;
bottom: 0;
left: 0;
right: 100%;
-webkit-transition: right 0.5s;
transition: right 0.5s;
}
a.listings:hover::before
{
right: 0;
}
three-columns is the div that contains the a elements with the class of listings
<div class="three-columns">
<a class="listings" href="#">dd</a>
</div>
Also, when i inspect my code in Chrome and set the size to 1366 x 768 which is also the size of my laptop screen, it looks okay. As soon as i close the inspector and come back to the real size, it starts behaving as it shows in the screenshot i attached.
Edit: Okay no, even the inspector shows that same behavior now