css li:before with direction from right to left -


i wrote code remove decimal point ordered list. code:

ol {   list-style-type: none;   counter-reset: level1  } ol li:before {   content: counter(level1) " ";    counter-increment: level1; } 

it don't show decimal point showed number's direction left right below

7   xxxxx 8   xxxxx 9   xxxxx 10  xxxxx 11  xxxxx 

desired result: right left notepad++ line numbers

 7  xxxxx  8  xxxxx  9  xxxxx 10  xxxxx 11  xxxxx 

i have tried css "direction: rtl" not worked. ideas on how achieve this? much!

try following solution:

ol {    list-style-type: none;    counter-reset: level1;  }  ol li:before {    content: counter(level1) ".";     counter-increment: level1;    display:inline-block;    text-align:right;    min-width:20px;  }
<ol>    <li>test 1</li>    <li>test 2</li>    <li>test 1</li>    <li>test 2</li>    <li>test 1</li>    <li>test 2</li>    <li>test 1</li>    <li>test 2</li>    <li>test 1</li>    <li>test 2</li>  </ol>


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - IE9 error '$'is not defined -