Slide up animation from line

You can take a look at animation and transform

p {
  margin: 0;
  height: 2em;
  overflow: hidden;
  width: max-content;
  margin: 0 auto;
  background: linear-gradient( currentcolor,currentcolor) center 85%/ 80% 2px no-repeat
}

p+p {
  background: none;
}

p span {
  display: inline-block;
  transform: translatey(4em);
  animation: slide 0.5s forwards;
}

p+p span {
  transform: translatey(-4em);
}

@keyframes slide {
  to {
    transform: translatey(0em)
  }
}


/* demo */

body {
background:#333;
color: #eee;
margin:0;
min-height:100vh;
display:flex;
flex-direction:column;
font-size:3vw;
justify-content:center;
}
}
<p><span>Some text here to slide up</span></p>
<p><span>Some text here to slide down</span></p>

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top