Home > database >  How to align the numbers of an ordered list to right?
How to align the numbers of an ordered list to right?

Time:10-16

Consider code below:

<body>
 <ol style="text-align:right;">
  <li>Peach </li>
  <li>Banana</li>
 </ol>
</body>

In the output, The list items are indeed in the right, but the number are not. How to also align the number at the right position?

CodePudding user response:

Add the rtl direction's attribute to ol tag: dir="rtl".

  • Related