Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to display multiple moving text in one line instead of multiple lines by marquee tag?

{% for term in terms %}
    <marquee behavior="scroll" direction="right" scrollamount="1" > {{ term }}</marquee>
{% endfor %}

For example, if terms is:

terms = ['term1', 'term2', 'term3']

They are currently displayed vertically and moving to the right:

term1
term2
term3

But I hope them to be displayed at one line when moving:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

term1 term2 term2

Is this possible with the marquee tag?

>Solution :

Just try

.marquee-wrapper {
  display: flex;
}

marquee {
  flex: 1;
}
<div class="marquee-wrapper">
    <span>Recent Items: </span>
    <marquee style="background-color: yellow;" behavior="scroll" direction="right" scrollamount="1">
        <!-- {% for term in terms %}
            {{ term }}
        {% endfor %} -->
        Text to move
    </marquee>
</div>

Which will put all the texts in a single marquee, and it will be moving one after another.

EDIT

Added background-color to the marquee tag

EDIT-2

Added a text right before the marqee

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading