0

我在选取框将文本方向更改为 rtl(从右到左)时遇到问题。这是代码:

<marquee direction="left" behavior="alternate" scrollamount="1" class="qus" dir="rtl">some text علي</marquee>

JSFiddle

它不动,但是当我删除它时dir="rtl"它工作正常。. . 但我需要dir="rtl".

4

5 回答 5

1

根据http://www.w3.org/html/wg/drafts/html/master/rendering.html#the-marquee-element

方向属性与文本方向无关,只处理动画。

http://jsfiddle.net/austinpray/pzDfV/

<marquee direction="right"  behavior="alternate" scrollamount="1" class="qus">some text علي</marquee>

这工作得很好。

马奎斯太糟糕了。我会重新考虑使用它们。

于 2013-07-02T06:12:05.430 回答
0

将 rtl 放在 div 中:

<marquee direction="left"  behavior="alternate" scrollamount="1" class="qus" ><div style="direction:rtl;">some text علي</div></marquee>
于 2013-07-02T06:15:12.937 回答
0

选框中没有属性“dir”,您可以使用方向“rtl”或右方向,您可以使用选框的替代方法liScroll

于 2013-07-02T06:17:48.917 回答
0

不要使用maquee!这是一个不推荐使用的元素...如果您绝对必须使用它,请在 CSS 中使用。

JSFiddle

CSS

body {font:12px arial, helvetica, sans-serif;} .marquee { width:130px; 高度:40px;填充:1px;背景颜色:红色;边框:1px纯黑色;空白:nowrap;溢出:隐藏;

溢出-x:-webkit-marquee;-webkit-marquee-direction:向后;-webkit-marquee-style:滚动;-webkit-marquee-speed:快;-webkit-marquee-increment:小;-webkit-marquee-repetition:无限;

溢出-x:选框线;选框方向:向前;选框样式:滚动;跑马灯速度:快;字幕播放计数:无限;}

HTML

<div class="marquee">
<p>some text علي</p>
</div>

切换方向

只需在 CSS 中将前向交换为后向。 JSfiddle 示例

于 2013-07-02T06:18:04.020 回答
0

marquee中没有属性"dir",可以使用 direction 属性来交换direction="left"by direction="right"

于 2021-09-22T14:21:54.180 回答