Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
How to scroll text within a card body to left when hovering the card-body text

I have a Bootstrap 5 card-body with a card-title and card-text with texts inside the card-body class. How can I style my CSS so that the card-title will automatically scroll horizontally when hovering over the card-title?

Example:

<div className="card-body ">
  <h5 style={{ textAlign: "center" }} className="card-title">
    <Link to={`/show/${userShow.show.id}`} className="stretched-link" id="links">
    <span style={{ fontWeight: "bold", color: "white" }}> {userShow.show.name} </span>
    </Link>
  </h5>
  <span className="card-text">
    <h6 style={{
   textAlign: "center",
   fontSize: "14px",
   fontWeight: 400,
   color: "white",
   }}> {" "} {userShow.show.publisher} </h6>
  </span>
</div>

Thanks in advance!

about 4 years ago · Juan Pablo Isaza
3 Respostas
Responde à pergunta

0

Here great article explaining how to do this.

.content {
  padding: 17px 0 17px 17px;
  width: 300px;
  height: 200px;
  overflow-y: scroll;
  mask-image: linear-gradient(to top, transparent, black),
    linear-gradient(to left, transparent 17px, black 17px);
  mask-size: 100% 20000px;
  mask-position: left bottom;
  -webkit-mask-image: linear-gradient(to top, transparent, black),
    linear-gradient(to left, transparent 17px, black 17px);
  -webkit-mask-size: 100% 20000px;
  -webkit-mask-position: left bottom;
  transition: mask-position 0.3s, -webkit-mask-position 0.3s;
}

.content:hover {
  -webkit-mask-position: left top;
}

@keyframes background {
  from {
    background: pink;
  }
  to {
    background: #c0d6ff;
  }
}

.wrapper {
  float: left;
  animation: background 5s infinite alternate;
}
<div class="wrapper">
  <div class="content">
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
  </div>
</div>

about 4 years ago · Juan Pablo Isaza Relatório

0

I'm assuming you mean a marquee effect.

The code below can create a marquee that scrolls only when you mouseover it, however I have been unable to make it stop by default, the onshow and onload properties don't seem to work.

<marquee
    onmouseover="this.start()"
    onshow="this.stop()"
    onload="this.stop()"
    onmouseout="this.stop()"
>
    Card heading
</marquee>
about 4 years ago · Juan Pablo Isaza Relatório

0

add css like this:

.card-body:hover .card-title{
 position: relative;
 animation: scroll  2s infinite;
      }
@keyframes scroll {
  0%,
  100% {
    margin-left: 0;
  }

  50% {
    margin-left: 200px;
  }
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda