21 CSS Button Hover Effects

Slide Doors

Two panels slide in from opposite sides and meet in the middle to fill the entire button.

Pure CSS MIT licensed

Slide Doors the 11th 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-11__btn"><span class="bhe-11__label">Slide Doors</span></button>
.bhe-11__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-11__btn {
  position: relative;
  overflow: hidden;
}
.bhe-11__btn::before,
.bhe-11__btn::after {
  content: "";
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: #7c6cff;
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}
.bhe-11__btn::before {
  left: 0;
  transform: translateX(-101%);
}
.bhe-11__btn::after {
  right: 0;
  transform: translateX(101%);
}
.bhe-11__btn .bhe-11__label {
  position: relative;
  z-index: 1;
  transition: color 0.4s;
}
.bhe-11__btn:hover::before {
  transform: translateX(0);
}
.bhe-11__btn:hover::after {
  transform: translateX(0);
}
.bhe-11__btn:hover .bhe-11__label {
  color: #fff;
}

Search CodeFronts

Loading…