Skip to content Skip to sidebar Skip to footer

Css Animate Scrolling Text Using Text-indent

I have created an 'Important Notice' bar where I want the text to scroll across the screen. It is achieved by animating the text-indent which seemed to work well until I had text w

Solution 1:

You can try using transform instead of text-indent.

jsFiddle

.sitemessage {
  display: inline-block;
  white-space: nowrap;
  animation: floatText 15s infinite linear;
  padding-left: 100%; /*Initial offset*/
}
.sitemessage:hover {
  animation-play-state: paused;
}
@keyframes floatText {
  to {
    transform: translateX(-100%);
  }
}
<divclass="sitemessage">
  START dfgh hgsl;k sfghjh fgdlj dflgh sg jls sdfhsdkjldfjksg sdfg ksjdfhg klsjdfhg lksjdfhg klsjdhg lksjdhfg sldkfjgh sdflgkjsdfglk jsdfg klsdfgl jksdfgl jksdfg ljsdfgkjl dafglkj adfgkl sdfgkjh END
</div>

Post a Comment for "Css Animate Scrolling Text Using Text-indent"