21 CSS Button Hover Effects

Center Underline Draw

A gradient underline expands symmetrically outward from the center of the button text.

Pure CSS MIT licensed

Center Underline Draw the 8th of 21 designs in the 21 CSS Button Hover Effects collection. The design is implemented in pure CSS — no JavaScript required. Copy the HTML and CSS panels below into your project. Because the demo is pure CSS, it works in any framework or templating engine you happen to use. The design honours prefers-reduced-motion and uses real semantic markup, so it ships accessibility-ready out of the box.

Live preview

Open in playground

The code

<button class="bhe-08__btn">Hover Me</button>
.bhe-08__btn {
  padding: 12px 32px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  color: inherit;
  background: transparent;
}

.bhe-08__btn {
  position: relative;
  background: transparent;
  border: none;
}
.bhe-08__btn::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  right: 50%;
  height: 2px;
  background: linear-gradient(90deg, #7c6cff, #ff6c8a);
  transition:
    left 0.4s cubic-bezier(0.23, 1, 0.32, 1),
    right 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  border-radius: 2px;
}
.bhe-08__btn:hover::after {
  left: 32px;
  right: 32px;
}

Search CodeFronts

Loading…