gdoron gdoron - 4 months ago 15
CSS Question

Differences between direction and text-align in css

What are the differences between:


  • direction : rtl

  • text-align: right



(Related to this question)

Answer

Direction orders your element from right to left.

Example:

<div style="direction: rtl">
  <div style="display: inline-block">A</div>
  <div style="display: inline-block">B</div>
</div>

outputs: B A

Text-align display your element in the right.

Example:

<div style="text-align: right; width: 979px">
  test
</div>

outputs test on the rightmost edge of the specified width.

Comments