21 CSS Button Hover Effects

Liquid Fill

Background floods upward like liquid filling a container via pseudo-element height transition.

Pure CSS MIT licensed

Liquid Fill the 1st 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-01__btn">Hover Me</button>
.bhe-01__btn {
  padding: 12px 32px;
  font-size: 13.5px;
  font-family: inherit;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.02em;
  background: transparent;
  color: inherit;
}

.bhe-01__btn {
  position: relative;
  color: #7c6cff;
  background: transparent;
  border: 2px solid #7c6cff;
  overflow: hidden;
  transition: color 0.4s;
  z-index: 0;
}
.bhe-01__btn::before {
  content: "";
  position: absolute;
  bottom: -2px;
  left: -2px;
  right: -2px;
  height: 0;
  background: #7c6cff;
  transition: height 0.45s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: -1;
}
.bhe-01__btn:hover {
  color: #fff;
}
.bhe-01__btn:hover::before {
  height: calc(100% + 4px);
}

Search CodeFronts

Loading…