字幕(HTML元素)

tech2023-01-12  99

句法 (Syntax)

< < marquee 字幕 align align = = " { “ { top | 顶部 | middle | 中间 | bottom } 底部 } " ” behavior 行为 = = " { “ { scroll | 滚动 | slide | 幻灯片 | alternate } 备用 } " ” direction 方向 = = " { “ { left | 左 | right } 右 } " ” loop 循环 = = " “ value (number of loops) 值(循环数) " ” bgcolor bgcolor = = " “ color name or hex value 颜色名称或十六进制值 " ” height height = = " “ integer (pixels or %) 整数(像素或%) " ” width width = = " “ number (pixels or %) 数字(像素或%) " ” hspace hspace = = " “ integer (pixels or %) 整数(像素或%) " ” vspace vspace = = " “ number (pixels or %) 数字(像素或%) " ” scrollamount scrollamount = = " “ number 数字 " ” scrolldelay scrolldelay = = " “ number 数字 " ” > > < < / / marquee 字幕 > >

描述 (Description)

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是一种更适合在屏幕上移动文本的技术。

(Example)

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>

将此用于… (Use this for…)

The marquee element should contain a short amount of text.

字幕元素应包含少量文本。

兼容性 (Compatibility)

Internet ExplorerFirefoxSafariOperaChrome5.56.07.08.01.01.52.01.32.03.14.09.29.510.02.0FullFullFullFullFullFullFullFullFullFullFullFullFullFullFull IE浏览器 火狐浏览器 苹果浏览器 歌剧 Chrome 5.5 6.0 7.0 8.0 1.0 1.5 2.0 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0 充分 充分 充分 充分 充分 充分 充分 充分 充分 充分 充分 充分 充分 充分 充分

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字幕滚动效果
最新回复(0)