I want to set the text on my animation html/css

Viewed 143
1 Answers

change css to

.h2-parent {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    max-width: 600px;
    width: 600px;
    padding-left: 10px;
    padding-right: 10px;
    z-index: 10;
}
h2
{
    position: relative;
    width: 100%;
    top: 40%;
    transform: translateY(-50%);
    font-size: 5vw;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
}
.abs-h2
{
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    color: #5865f2;
    -webkit-text-stroke: 0vw rgb(51, 51, 51);
    border-right: 2px solid #5865f2;
    overflow: hidden;
    animation: animate-t 6s linear infinite;
}

.abs-h2 h2
{
    position: relative;
    width: 600px;
    top: 40%;
    left:10px;
    transform: translateY(-50%);
    font-size: 5vw;
     color: #5865f2;
    text-transform: uppercase;
    
}

and change html to

<div class="h2-parent">
  <h2 data-text="Improve your Server...">Improve your Server...</h2>
  <div class="abs-h2">
    <h2 data-text="Improve your Server...">Improve your Server...</h2>
  </div>
</div>

demo in js<>fiddle

Related