Rtl Is on Web Page Reverses Numbers with a Dash

Change direction of negative number with combination of LTR and RTL content

Since your screenshot has the "-2" in a different span element you could is the unicode-bidi option on that specific span:

div{

direction: rtl;

}

span{

direction: ltr;

unicode-bidi: bidi-override;

}
<div>

امروز

<span>-2</span>

</div>

How to properly display RTL text followed by number in svg text element for Chrome/Firefox/IE/Edge?

Add dir attribute and add "rtl" as value in text element inside SVG to show RTL text in IE/Edge.

Check link for updated code:
https://jsfiddle.net/ru7xzydv/3/

Angular's UI-Grid in RTL Mode displays data in wrong order opposite to the order of columnDefs

Apparently, had to explicitly assign the dir="rtl" to the ui-grid inside the element, i think the *{direction=rtl;} in _Layout.cshtml was overriden bu ui-grid css.

When line of text starts with a number, a number shows up on right in RTL mode. Why?

The dir attribute sets the directionality of directionally neutral text, as well as overall layout direction (e.g., the layout order of table columns). Latin letters are not directionally neutral; they have strong left-to-right directionality.

The content 5 little ducks went out to play. consists of three parts, as far as directionality is considered: the character 5, the string of Latin letters with spaces, and the character .. When right-to-left directionality is applied to this, you get these parts in order, from right to left.

When you replace 5 by 5a, the directionally neutral 5 gets governed by the left-to-right characeter a, so the string 5a is treated as belonging to the sequence of left-to-right characters.

When you have The 5 little, the neutral 5 again gets joined into the left-to-right gang, because it is between two strongly left-to-right strings.

This is all described in Unicode BiDi rules.

When you set unicode-bidi: bidi-override in CSS or, equivalently, use the <bdo> element in HTML, you override the entire Unicode BiDi algorithm. All of the inherent directionality associated with letters gets ignored. Characters are laid out strictly left to right or right to left, no matter what.

Locales and encodings have nothing to do with this.

The moral is that you should normally set directionality only for texts that are conventionally written right to left, such as Hebrew, Arabic, or Persian. If you use directionality just for casual layout purposes, take care; it may bite you. And if you have mixed left-to-right or right-to-left texts, use embedding (unicode-bidi: embed) rather than brute-force directionality override.



Related Topics



Leave a reply



Submit