Symbols in right aligned textbox
-
29-04-2021 - |
Frage
I have textbox in my web application , which is right aligned . When i type normal charters (such as a, b c ...) it works properly .But if i type a $name , it appears as name$ . Why is it so .Is there any solution to avoid this . I use javascript to set the alignment $("#<%=txtName.ClientID %>").css('direction', 'rtl');
Lösung
You have probably used the dir
attribute/CSS set to rtl
instead of proper CSS alignment.
The dir
attribute:
This attribute specifies the base direction of directionally neutral text (i.e., text that doesn't have inherent directionality as defined in [UNICODE]) in an element's content and attribute values. It also specifies the directionality of tables.
As you can see this is not limited to alignment.
Use CSS alignment/positioning to align HTML controls.