Why does this have a huge margin?

<!DOCTYPE html>
<title>Page Title</title>

  position: relative;
  display: inline-block;
  overflow: hidden;

  border: none;
  outline: none;

  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


 <div class="input-name">
<p id="title">ABCDFEDF </p>
  <span class="underline-animation"></span>

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?

At the bottom of your screenshot, you can see where the margin is defined, in user agent stylesheet, i.e. what your browser has for defaults.

To get rid of it, add something like

p {
  margin: 0;

This assumes all your paragraphs need the margin removed. If its just one, you can use the id you have setup …

#title {
  margin: 0;

I didn’t bother to look at the auto styles lol. Thanks!