0

我正在使用以下 CSS 从右到左阅读文本:

.rtl { unicode-bidi:bidi-override;direction:rtl;width:300px;}

<span class="rtl">.tfel οt thgir mοrf daer si txet sihT</span>

它是一个实验站点的一部分,它将显示源代码中的所有文本反转,但对用户来说是可读的。

如果我只有一个文本句子,它会很好用。但是,一旦文本的长度大于元素的大小(在这种情况下为 300 像素),句子的顺序就不再起作用。例如:

资源:

<div class="rtl"> .skaerb txet eht ,htgnel niatrec a tsaP .yllamron demrof era shpargarap eht rehtehw ees ot secnetnes lareves dedulcni ev'I dna ,tfel ot thgir morf daer si txet sihT</div>

输出:

(因为我不能发布图片,所以它是:http: //img4.hostingpics.net/pics/990715343.jpg

如您所见,第一句“This text is read from right to left”在底部对齐,这意味着段落的顺序是错误的。

是否有另一种方法可以使文本正常从上到下流动并从右到左阅读?

谢谢

4

1 回答 1

0

It seems (as I explain in a comment) that you actually want text lines to be laid out bottom to top. There is currently no standard or cross-browser way to achieve that. On IE (version 8 and newer) you can use writing-mode: rl-bt (right to left, bottom to top). You might also wish to set text-align: left, since right-to-left direction implies by default right alignment, which is OK for right-to-left languages, but not so for tricks on writing direction for left-to-right languages.

于 2014-05-06T08:37:54.927 回答