简体   繁体   中英

marquee property to scroll text left right

what property in marquee tag that allows me to scroll the marquee content continuously ? If I have 5 items as its content, I would like to separate space equally for all 5 items, AND also for the space between the 5th of one scroll and the first of the next roll.

Because normally the marquee will finish all items before it starts the next scroll but the last item and the first item are separated more than each item present in the marquee content, in my case.

For example, 1-2-3-4-5-1-2-3-4-5-1-2-3-4-5 etc each "-" is the space and time divided equally for items in the marquee. Thank you

The loop attribute is what you are looking for with a value of -1 means scroll continuously. You can find more information from the Mozilla Developer Network Documentation .

I feel I should warn you up front that the marquee tag is not a standard tag and will render differently in all browsers. Many attributes are not supported cross browser. You my want to find a suitable jQuery plugin to handle cross browser for you. If you are doing something simple then the marquee tag may work for you, though I wouldn't advocate it.

As for width, you can put each item in a container such as a div tag then add appropriate margin as fit as such:

<marquee>
    <div>1</div>
    <div>2</div>
</marquee>

If you'd like to be more "syntactically correct" You might use a ul with li tags

<marquee>
    <ul>
        <li>1</li>
        <li>2</li>
     </ul>
</marquee>

More html/css but grouped a little more logically for screen readers and print purposes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM