# Set direction of text depending on text itself

**URL:** <https://meta.discourse.org/t/set-direction-of-text-depending-on-text-itself/54016>\
**Category:** Feature\
**Tags:** pr-welcome\
**Created:** [Décembre 9, 2016, 1:30 UTC](https://meta.discourse.org/t/set-direction-of-text-depending-on-text-itself/54016 "2016-12-09T13:30:41Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![hnaseri](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hnaseri/32/120660_2.png) [@hnaseri](https://meta.discourse.org/u/hnaseri)\
**Post date:** [Juin 13, 2017, 11:08 UTC](https://meta.discourse.org/t/set-direction-of-text-depending-on-text-itself/54016/8 "2017-06-13T23:08:23Z")

</div>

I just found that there is an html5 tag `dir=auto` that simply works in most situations.

For example I wrote this html

```
<html>
<body>

<p dir="auto">Write this جمله چپ به راست text left-to-right!</p>

<p dir="auto">این RTL sentence جمله را از راست به چپ بنویس</p>

</body>
</html>

```

And pasted it in a simple html editor and it works perfectly fine

 ![](https://global.discourse-cdn.com/meta/original/3X/a/3/a3be28ff7fa986538573f419d1131852878a361d.png)

Could we use the same thing in discourse @sam?

---

_[View the full topic](https://meta.discourse.org/t/set-direction-of-text-depending-on-text-itself/54016)._
