Center li list number ol

I have a list of ol . This list is populated with li , which contains text that can be on multiple lines. What I want to do is center the number that indicates the position in the list.

Example:

 <ol> <li> Text in multiple line </li> </ol> 

Will do:

  1. Text in multiple line 

The β€œ1” in the previous example is what I want to position in the middle center. Is it possible. If so, how can I do this.

+4
source share
3 answers

I think this may be what you are looking for:

 <style> li span { display: inline-block; vertical-align: middle; } </style> <ol> <li> <span>Text in <br />multiple lines</span> </li> <li> <span>Text in one line</span> </li> </ol> 
+8
source

Use

 <ol> <li>Text in </br>multiple line</li> </ol> 

fiddle

0
source

If the list item should go to the center, try this

 <ol> <li style="text-align:center;"> Text in multiple line </li> </ol> 
-2
source

All Articles