Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Underline button animation

I can’t understand ho I can replicate this effect on button, like in this theme:(scroll below and look where button say "read more") https://hiroshi.qodeinteractive.com

my button class: border-button

    .border-button {
  font-family: "Montserrat";
  display: inline-block;
  text-decoration: none;
  position: relative;
  padding: 12px 8px;
  color: #000;
  overflow: hidden;
}

.border-button::before {
  content: "";
  color: black;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: #000;
  transform: translateX(-100%);
  transition: transform 0.4s ease-out;
}

.border-button:hover::before {
  color: black;
  transform: translateX(0);
}
a:hover{
    color: black;
}

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

CSS transition allows you to change property values smoothly, over a given duration.

Try using the transition property with background properties like this:

.myanime {
  cursor: pointer;
  background-image: linear-gradient(to right, #000 33%,#0000 33% 66%,#000 66%);
  background-position: right bottom;
  background-size: 300% 2px;
  background-repeat: no-repeat;
}

.myanime:hover {
  background-position: left bottom;
  transition: background-position 1s;
}
<span class="myanime">read more</span>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading