Home >Web Front-end >CSS Tutorial >Can CSS Change Text Direction from Left to Right?
Changing Text Direction in CSS: Right to Left
Question:
Is it possible to reverse the text direction of a given string using CSS? For instance, transforming "This is it" into "ti si sihT"?
Answer:
Certainly, CSS offers a set of properties that enable you to control text direction. To achieve the desired right-to-left text orientation, apply the following CSS class to the target element:
<code class="css">.cssClassName { direction: rtl; unicode-bidi: bidi-override; }</code>
Additional Information:
Usage:
To apply this right-to-left formatting, assign the ".cssClassName" class to a paragraph tag containing the text you want to reverse. For example:
<code class="html"><p class="cssClassName">This is it</p></code>
Resulting in:
<code class="text">ti si sihT</code>
The above is the detailed content of Can CSS Change Text Direction from Left to Right?. For more information, please follow other related articles on the PHP Chinese website!