双向覆盖“bdo”的实际目的是什么?
在来这里之前,我通过谷歌搜索进行了尝试。在我阅读这两个链接后
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
非常简单。如果您正在使用默认语言(例如英语,从左到右呈现)编写网页,并且您想要包含另一种语言的文本岛,例如希伯来语中的引述,则从右呈现-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
我尝试了下面的代码,发现它对于希伯来语显然已经过时了,至少:
两者似乎都输出同一行,这让我感到困惑,但促使我进行了搜索,找到了以下文章:
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:
Both seemed to output the same line, which confused me, but prompted a search that lead me to the following article:
http://fantasai.tripod.com/qref/HTML4/structure/bdo.html
Hope it helps
试试这个:
这是从右到左的英文文本
< 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>