The marquee element provides a way for browsers to render text that moves across the page without having to resort to JavaScript techniques. The marquee is non-standard but enjoys (or possibly suffers from) good browser support.
marquee元素为浏览器提供了一种呈现在整个页面上移动的文本的方法,而无需诉诸JavaScript技术。 该选框是非标准的,但享受(或可能遭受)良好的浏览器支持。
It is generally considered to be a very unfriendly element to use, one which presents difficulties for many users who may have difficulty tracking the text as it moves. Our advice is not to use it. JavaScript is a more suitable technique for moving text on screen – if there is a valid reason for doing this at all.
通常认为它是一种使用起来非常不友好的元素,它给许多可能在文本移动时难以跟踪的用户带来了困难。 我们的建议是不要使用它。 如果有充分的理由,JavaScript是一种更适合在屏幕上移动文本的技术。
A simple marquee with no additional attributes is marked up as follows:
没有其他属性的简单选取框标记如下:
<p><marquee>This text is a moving target. Don't you just love it?</marquee></p>The marquee element should contain a short amount of text.
字幕元素应包含少量文本。
Support for marquee is varied. Some browsers will stop animation regardless of loop settings, some interpret direction differently, some will honor height and width attributes, most pay no attention at all. However, given that this is not part of any HTML recommendation, this is perhaps to be expected. The simple answer is not to use it if you want to have valid documents that render consistently and don’t annoy the heck out of the reader.
对选框的支持多种多样。 某些浏览器会在不考虑循环设置的情况下停止动画,某些浏览器会以不同的方式解释方向,某些浏览器会使用height和width属性,而大多数浏览器根本不会关注。 但是,鉴于这不是任何HTML建议的一部分,因此这可能是可以预期的。 一个简单的答案是,如果您希望拥有有效的文档,这些文档能够始终如一地呈现并且不会惹恼读者,请不要使用它。
翻译自: https://www.sitepoint.com/marquee-html-element/
相关资源:HTML字幕滚动效果