Tips for aligning ordered list numbers to the right
P粉174151913
2023-08-31 12:03:12
<p>Consider the following code:</p>
<p>In the output, the list items are indeed on the right, but the numbers are not in the right position. How can I align the numbers to the right position as well? </p>
<p>
<pre class="brush:css;toolbar:false;">ol {
width: 15vw;
}</pre>
<pre class="brush:html;toolbar:false;"><ol style="text-align:right;">
<li>Orange</li>
<li>Apple</li>
<li>Mango</li>
<li>Pineapple</li>
<li>Pear</li>
<li>Grape</li>
<li>Watermelon</li>
<li>Strawberry</li>
<li>Blueberry</li>
<li>Raspberry</li>
<li>Kiwi</li>
</ol></pre>
</p>
Add the rtl direction attribute to the
ol
tag:dir="rtl"
.