Setting the direction
property for the body
tag can determine whether the text should flow from left to right (ltr
) or right to left (rtl
). Similarly, individual elements can have their own text-align
properties set.
Is there a way to streamline coding efforts in designing an application that can support both English (LTR
) and Arabic (RTL
) languages? I could write separate CSS for each direction, but what is the best way to switch between these CSS styles (e.g. in the master page load event)?
In some cases, such as when using English language, the first column of a grid may need to have text-align:left
(containing text), while the remaining columns should be aligned with text-align:right
due to containing numeric values. The scenario would then be reversed for Arabic language content.