html - Positioning list item numbers by last digit...? -


i have dynamically generated ordered list maximum of 105 items. i'm styling li numbers li:before, , fine, once list gets triple digits numbers begin overlapping list items. obscures end of number , part of li itself. want have li numbers aligned last digit opposed first digit. i'm not sure how ask this, why i'm having trouble finding answer. example below:

how list item numbers seem display default:

1. 5. 10. 50. 100. 

what i'm trying achieve:

  1.   5.  10.  50. 100. 

i've experimented bit adding

direction: rtl  

and

text-align-last: right 

to li:before, neither seem doing anything.

thanks help, , sorry if stupid question!

edit: here's css. thanks!

 li:before {    text-shadow: 2px 2px 4px #000000;    margin-left:-20px;    margin-top:25px;    content: counter(item);    color: white;    display: inline-block;    font-size:2rem;    direction: rtl;    text-align-last: right;  } 

can post more of html , css can understand doing currently.

by default, ordered list right align item numbers. have achieved think after this:

ol li {    /* style list number */    color: red;    font-size: 20px;    font-weight: bold;  }    ol li span {    /* style list item text */    color: green;    font-size: 14px;    font-weight: normal;  }
<ol>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>    <li><span>item text</span></li>  </ol>


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -