<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<style>
.input-name{
position: relative;
display: inline-block;
overflow: hidden;
}
#title{
border: none;
outline: none;
}
.underline-animation{
transition: 1s linear;
display: inline-block;
bottom: 0;
left: 0;
position: absolute;
width: 100%;
height: 2px;
background-color: rgba(255,69,0,0.5);
}
#title:hover + .underline-animation{
height: 25px;
transition: 1s;
}
/*
a > b means selects all b where a is the parent
b + c means all c placed immediately after b
*/
</style>
</head>
<body>
<div class="input-name">
<p id="title">ABCDFEDF </p>
<span class="underline-animation"></span>
</div>
</body>
</html>
I’m copying the animation on Hackernoon for links - there’s a span underlining the link and then it increases in heights and becomes a highlight. I was mostly able to do it by messing around with someone else’s code, but here’s this massive margin around it:
I don’t have any styling setting the margin to 16. How do I get rid of it?