How to make a label with behavior="scroll"?

2

Follow the code below:

<marquee behavior="scroll" direction="left">Seu texto aqui</marquee>

How can I do this with label?

<label class="col-sm-2 col-form-label" for="Link">Seu texto aqui</label>
    
asked by anonymous 09.08.2017 / 23:43

1 answer

2

You can emulate the behavior of <marquee> (which is currently indicated as deprecated), in CSS with animation and translate() .

.marquee {
  width: 100%;
  margin: 0 auto;
  white-space: nowrap;
  box-sizing: border-box;
  overflow: hidden;
}

.marquee-scroll {
  display: inline-block;
  padding-left: 100%;
  animation: scroll 10s linear infinite;
}

@keyframes scroll {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-100%, 0);
  }
}
<div class="marquee">
  <label for="Link" class="marquee-scroll">Seu texto aqui</label>
</div>
    
19.10.2018 / 18:38