双向覆盖“bdo”的实际目的是什么?

发布于 2024-08-08 20:24:31 字数 400 浏览 9 评论 0原文

在来这里之前,我通过谷歌搜索进行了尝试。在我阅读这两个链接后

http://www.w3schools.com/tags/tag_bdo.asp< /a>

http://www.w3schools.com/tags/tryit.asp ?filename=tryhtml_bdo

我还是不太明白实际用途是什么?

预先感谢那些对此有所了解的人。

Before coming here, I tried myself by googling. After I read these two links

http://www.w3schools.com/tags/tag_bdo.asp

http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_bdo

I still don't understand clearly what is the practical purpose?

Thanks in advance for those who shed some light on this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

Bonjour°[大白 2024-08-15 20:24:31

非常简单。如果您正在使用默认语言(例如英语,从左到右呈现)编写网页,并且您想要包含另一种语言的文本岛,例如希伯来语中的引述,则从右呈现-to-left 您可以使用此标签来覆盖将文本写入页面的基本方向,以防双向算法出错。当然,您需要确保您使用的字体也支持适当的字符集。

http://www.w3.org/TR/ html40/struct/dirlang.html

Pretty striaghtforward. If you're writing a web page using a default language, such as English, that is rendered left-to-right, and you want to include a island of text in another language, such as a quote in Hebrew, that is rendered right-to-left you can use this tag to override the base direction in which the text is written onto the page in case the bi-directional algorithm is getting it wrong. You need to make sure that the font you're using supports the appropriate character set too, of course.

http://www.w3.org/TR/html40/struct/dirlang.html

維他命╮ 2024-08-15 20:24:31

我尝试了下面的代码,发现它对于希伯来语显然已经过时了,至少:

<!DOCTYPE html>
<html>
<body>

<p>If your browser supports bi-directional override (bdo), the next line will be written from right to left (rtl):</p>

<p>חדשות, ידיעות מהארץ והעולם - עיתון הארץ</p>
<bdo dir="rtl">חדשות, ידיעות מהארץ והעולם - עיתון הארץ</bdo>

</body>
</html>

两者似乎都输出同一行,这让我感到困惑,但促使我进行了搜索,找到了以下文章:

AbiWord 中文本的双向排序是自动完成的,
严格遵循 Unicode 双向算法(UBA;请参阅
Unicode 联盟网站)。 Unicode 字符集分配每个
特征某些方向属性,然后由
UBA 订购文本。因此,希伯来语或阿拉伯语字符将
自动被视为从右到左,英文字符被视为
从左到右。有些角色是有方向性的
模棱两可,UBA 如何对待他们取决于什么
在其附近找到字符(这包括所有空白
和标点符号)。

http://fantasai.tripod.com/qref/HTML4/struct/bdo.html

希望有帮助

I tried the code bellow, and noticed that it is apparently obsolete for Hebrew, at least:

<!DOCTYPE html>
<html>
<body>

<p>If your browser supports bi-directional override (bdo), the next line will be written from right to left (rtl):</p>

<p>חדשות, ידיעות מהארץ והעולם - עיתון הארץ</p>
<bdo dir="rtl">חדשות, ידיעות מהארץ והעולם - עיתון הארץ</bdo>

</body>
</html>

Both seemed to output the same line, which confused me, but prompted a search that lead me to the following article:

The bidirectional ordering of text in AbiWord is done automatically,
closely following the Unicode Bidirectional Algorithm (UBA; see the
Unicode Consortium website). The Unicode character set assigns each
character certain directional properties which are then used by the
UBA to order text. Thus, Hebrew or Arabic characters will
automatically be treated as right-to-left, and English characters as
left-to-right. There are some characters that are directionally
ambiguous, and how they are treated by the UBA depends on what
characters are found in their vicinity (this includes all white space
and punctuation characters).

http://fantasai.tripod.com/qref/HTML4/structure/bdo.html

Hope it helps

岁月染过的梦 2024-08-15 20:24:31

试试这个:

这是从右到左的英文文本

< p dir="ltr">执行任务

Try this:

<!DOCTYPE html><html><body><p dir="rtl"><bdo>This is a right to left English text</bdo></p><p dir="ltr"><bdo>זהו טקסט עברי משמאל לימין</bdo></p></body></html>

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文