V
V
Viktor Burdale2019-01-04 12:15:43
css
Viktor Burdale, 2019-01-04 12:15:43

How to make text animation (marquee) based on content?

There is a task to make the text scroll (running line) when the cursor is hovered, provided that the text does not fit into the block. If the text fits, then the animation is not needed.

<div>
        <h1>Длинный текст</h1>
</div>

The very animation of the text when hovering with the cursor is easy to do. But the main question is how to specify the condition that the content does not fit? Is it implementable in CSS? Or without JS it will not be possible to solve the issue?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question