9

What is the difference between using bdo

<bdo dir="rtl">CIBARA english EMOS</bdo>

and using most tags with dir attribute like

<span dir="rtl">CIBARA english EMOS</span>

I know this question is similar to should i always use bdo for text direction?, but I still do not understand why the use of the dir attribute is "adequate" and bdo is not needed.

Doesn't the dir attribute "override the inherent directionality of letters" anyway? In which instances must I use bdo?

Community
  • 1
  • 1
obsessiveCookie
  • 1,130
  • 2
  • 18
  • 33
  • This will help you understand better: **( http://www.w3.org/TR/html401/struct/dirlang.html#h-8.2 )**. Read carefully until end. You would have understood it clearly, by the time you reach this line: "*... The BDO element should be used in scenarios where absolute control over sequence order is required (e.g., multi-language part numbers).*" – Abhitalks May 26 '14 at 12:52
  • In a nutshell, `bdo` is for the serious stuff and for the general use `dir` works well – user10089632 Aug 25 '17 at 22:06

1 Answers1

3

Using -

<span dir="rtl">CIBARA english EMOS</span>

Styles applied in Chrome:

span[Attributes Style] {
    direction: rtl;
    unicode-bidi: isolate;
}

Using -

<bdo dir="rtl">CIBARA english EMOS</bdo>

Styles applied in Chrome:

bdo[Attributes Style] {
    direction: rtl;
}

bdo {
    unicode-bidi: bidi-override;
}

So, with the use of <bdo> element, the default value bidi-override is always applied in most browsers and it should work as intended. The use of attribute dir does not seem to be adequate. See below:

<!DOCTYPE html>
<html>
<body>

<p>This paragraph will go left-to-right.</p>  
<p><span dir="rtl">This paragraph will go right-to-left.</span></p>
<p><bdo dir="rtl">This paragraph will go right-to-left.</bdo></p>  

</body>
</html>
pixlboy
  • 1,452
  • 13
  • 30