0

So I am trying to create an animated line, which would move link ca 15px to the right when it's hovered...so - the line would not be visible before, but when the link is hovered it should appear and grow 15px to the right. However the span element with red background does not seem to appear - any ideas why does this happen..?

.link-animation {
    height: 2px;
    width: 0px;
    background-color: red;
}

.link:hover .link-animation {
    width: 15px;
}
<a class="link" href=""><span class="link-animation"></span>Animate on hover</a>
Smithy
  • 807
  • 5
  • 17
  • 43

0 Answers0