79204740

Date: 2024-11-19 19:06:47
Score: 1.5
Natty:
Report link

It seems that you have written your code in wrong hierarchy.

enter image description here

$color: #333;

.underline-button {
  color: $color;
  cursor: pointer;
  user-select: none;
  text-align: center;
  padding: 15px 0;
  font-size: 24px;

  &:after {
    content: "";
    display: block;
    width: 50%;
    height: 1px;
    margin-left: auto;
    margin-right: auto;
    background: $color;
    transition: width 0.3s;
  }

  &:hover {
    &:after {
      width: 100%;
    }
  }

  &:active {
    :after {
      width: 0;
    }
  }
}
<div>
  <div class="underline-button">Button</div>
  <div class="underline-button">Button</div>
  <div class="underline-button">Button</div>
  <div class="underline-button">Button</div>
  <div class="underline-button">Button</div>
  <div class="underline-button">Button</div>
</div>

As your code is in .SCSS please check this.

Reasons:
  • Blacklisted phrase (1): please check this
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Naeem Akhtar