Ali Husham
Ali Husham

Reputation: 936

I can't make text direction right to left?

I'm trying to add the Arabic language to my paragraphs but it appears from left to right. I tried <HTML lang="ara"> and I tried to do it from .css file, but nothing worked with me.

<p lang="ara" dir='rtl' className='title-field' contentEditable />

Upvotes: 0

Views: 470

Answers (2)

James Rushford
James Rushford

Reputation: 156

This seems to work fine, run the code snippet to see

<p lang="ara" dir='rtl' className='title-field'> نص الاختبار</p>

Upvotes: 0

Yalcin Kilic
Yalcin Kilic

Reputation: 800

the html-tag gets the direction-attribute

<html dir="rtl">
  <body>
    <p>aligned right</p>
  </body>
</html>

You can also style specific elements with the direction property:

direction: rtl;

Upvotes: 1

Related Questions