3,860
edits
(Corr.) |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 36: | Line 36: | ||
The {{tag|bdi|o}} tag ''derives'' the direction of the text it encloses from the text itself. You don't include any directional information. The {{tag|bdo|o}} tag, however, ''forces'' the text it encloses to flow in a certain direction, specified through the attribute <code>dir{{=}}</code>. | The {{tag|bdi|o}} tag ''derives'' the direction of the text it encloses from the text itself. You don't include any directional information. The {{tag|bdo|o}} tag, however, ''forces'' the text it encloses to flow in a certain direction, specified through the attribute <code>dir{{=}}</code>. | ||
Because of that, {{tl|bdo}} shouldn't be used in cases where the direction of the inserted text is unknown, but is a good alternative if {{tl|bdi}} | Because of that, {{tl|bdo}} shouldn't be used in cases where the direction of the inserted text is unknown, but it is a good alternative if {{tl|bdi}} should fail to derive the direction. | ||
====<bdi>==== | ====<bdi>==== | ||
The {{tag|bdi|o}} tag is used in the same way, regardless of the text direction of the inserted string. | |||
{| class="wikitable" style="background-color: white;" | |||
|- | |- | ||
| {{tlc|bdi|من اليمين إلى اليسار}} | ! Case !! What you type !! What you see !! Comments | ||
|- | |||
| rowspan="2" | {{tag|bdi|o}} adapts to <br>the text direction of <br>the enclosed string || {{tlc|bdi|من اليمين إلى اليسار}} || {{bdi|من اليمين إلى اليسار}} || rowspan="2" | Works for both <tt>rtl</tt> and <tt>ltr</tt> input | |||
|- | |||
| {{tlc|bdi|From left to right}} || {{bdi|From left to right}} | |||
|} | |} | ||
Line 48: | Line 52: | ||
The {{tag|bdo|o}} tag may make the text virtually unreadable, if used incorrectly. Mind the <code>dir{{=}}</code>. | The {{tag|bdo|o}} tag may make the text virtually unreadable, if used incorrectly. Mind the <code>dir{{=}}</code>. | ||
;<big> | ;<big>Correct</big> | ||
{| | {| class="wikitable" style="background-color: white;" | ||
| {{ | |- | ||
! Case !! What you type !! What you see !! Comments | |||
|- | |||
| rowspan="2" | {{tag|bdo|o}} has a preset <br>directional output || {{tlc|bdo|من اليمين إلى اليسار}} || {{bdo|من اليمين إلى اليسار}} || The default direction is <tt>rtl</tt> | |||
|- | |- | ||
| {{tlc|bdo|dir{{=}}ltr| | | {{tlc|bdo|dir{{=}}ltr|From left to right}} || {{bdo|dir=ltr|From left to right}} || <tt>ltr</tt> must be explicitly specified | ||
|} | |} | ||
;<big> | ;<big>Incorrect</big> | ||
{| | {| class="wikitable" style="background-color: white;" | ||
| {{tlc|bdo|dir{{=}}ltr| | |- | ||
! Case !! What you type !! What you see !! Comments | |||
|- | |||
| rowspan="2" | Wrong value for <br>the {{code|dir}} attribute || {{tlc|bdo|dir{{=}}ltr|من اليمين إلى اليسار}} || {{bdo|dir=ltr|من اليمين إلى اليسار}} || rowspan="2" | The text is displayed backwards ({{tag|bdo|o}} forces the direction) | |||
|- | |- | ||
| {{tlc|bdo| | | {{tlc|bdo|From left to right}} || {{bdo|From left to right}} | ||
|} | |} | ||
==See also== | ==See also== | ||
* {{tl|bdo}}: inserts {{tag|bdo|o}} tags | * {{tl|bdo}}: inserts {{tag|bdo|o}} tags, forcing inline changes in text direction. | ||
* {{tl|abbr}}: inserts {{tag|abbr|o}} tags to include a tooltip explanation of an abbreviation. | * {{tl|abbr}}: inserts {{tag|abbr|o}} tags to include a tooltip explanation of an abbreviation. | ||
* {{tl|code}}: inserts {{tag|code|o}} tags. | * {{tl|code}}: inserts {{tag|code|o}} tags. | ||
* {{tl|mark}}: inserts {{tag|mark|o}} tags. | * {{tl|mark}}: inserts {{tag|mark|o}} tags, highlighting the enclosed text. | ||
* {{tl|samp}}: inserts {{tag|samp|o}} tags. | * {{tl|samp}}: inserts {{tag|samp|o}} tags. | ||
* {{tl|var}}: inserts {{tag|var|o}} tags. | * {{tl|var}}: inserts {{tag|var|o}} tags. |
edits