css-pagination-with-hover-effect

Pure CSS pagination with hover effect for pages or sliders. Hover effect made with liner gradient for background-image and other CSS background properties: background-size, background-position.

-webkit-background-clip, -webkit-text-stroke, -webkit-text-fill-color used for text effects.
Compatible browsers: Chrome, Edge, Firefox, Opera, Safari.


1 / 4

@import url('https://fonts.googleapis.com/css?family=Maven Pro:500,700&display=swap');

body {
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

div.wrapper {
  margin: auto;
}

button {
  border: none;
  margin: 0;
  padding: 0;
  font-family: 'Maven Pro', sans-serif;
  font-size: 80px;
  font-weight: 700;
  cursor: pointer;
  -webkit-background-clip: text;
  -webkit-text-stroke: 1px #313131;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(133deg, rgba(255,0,0,1) 0%, rgba(255,0,0,1) 50%, rgba(255,255,255,1) 50%, rgba(255,255,255,1) 100%);
  background-size: 300%;
  background-position: 100% 0;
  transition: background-position .5s ease-in, font-size .2s ease-in;
}

button.disabled {
  -webkit-text-stroke: .7px #bebebe;
  background: none;
  cursor: default;
}

button:hover {
  background-position: 0 0;
}

.pagination-state {
  position: relative;
  display: inline-block;
  top: -17px;
  width: 60px;
  text-align: center;
  font-family: 'Maven Pro', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #313131;
  transition: top .2s ease-in;
}

@media screen and (max-width: 640px) {
  button {
    font-size: 60px;
  }
  .pagination-state {
    top: -11px;
  }
}

@media screen and (max-width: 420px) {
  button {
    font-size: 40px;
  }
  .pagination-state {
    top: -6px;
  }
}