Lenik
Lenik

Reputation: 14458

Custom LI format in HTML?

I want to display list items with a prefix, like:

  ML-1. ..........................
        ...................
  ML-2. ........
  ML-3. ...................
        ............
ML-100. .........................
        ............

Is it possible? I tried to use li:before { content: "ML-" counter(item) ". "; } however it seems like not supported well in many browsers. And I can't make the numbers right aligned.

Upvotes: 2

Views: 347

Answers (2)

Winfield Trail
Winfield Trail

Reputation: 5695

I'm pretty sure that isn't possible. Your best bet would be to use a blank-styled unordered list and put the prefix in the body of each LI.

Upvotes: 3

Dimitri
Dimitri

Reputation: 7013

You could do that with jQuery. Unless you don't want to have it on the page? Or if you provide a little more details on how you populate the list i could suggest something else

Upvotes: 0

Related Questions