Dir attribute in multilingual text

Should I add dir="ltr" to the following anchor tag?

<!DOCTYPE html>
<html dir="rtl" lang="fa">
  <head>
    <meta charset="UTF-8">
    <title>نمونه</title>
  </head>
  <body>
    <ul>
      <li>اپلیکیشن <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.tachyon" lang="en">Google Meet</a> را نصب کنید.</li>
      <li>با کلیک بر روی یکی از لینکهای زیر، وارد کلاس مورد نظر شوید.</li>
    </ul>
  </body>
</html>

Yes, I think so. Or you could use the auto value which will let the browser decide on the direction.

applies that directionality to the whole element.
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir

Though this suggests you may need another dir attribute for the parts that are English.

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.