Warm tip: This article is reproduced from stackoverflow.com, please click
css html

last charecter on rtl goes first of the line

发布于 2020-03-27 10:15:57

in my html the below string will generated by js and it will append to a p tag ... my html is RTL since the language is Persian but in some points i have englihsh characters like this.

#C   C#  D

but the above generated string is displayed like this

C    C#   D#

I tested this code but not worked for me :

unicode-bidi: bidi-override;

This is my Code :

<p id="chord-3" class="chord">C        C#       D#  </p>
Questioner
SajjaD Ebrahimi RaaD
Viewed
116
adel 2019-07-03 22:06

*{
  margin:0;
  padding:0;
}
html{
  direction:rtl
}
.ltr{
  direction:ltr;
  text-align:right;
}
<p class="ltr">#C   C#  D</p>
<p>مرحبا</p>

well add a class to this english word width css:

 direction:ltr;
  text-align:right;