Center li number of a ol list
I have a ol
list. This list is fill with li
that contains text that can be on multiple line. What I want to do is to center the number that mark the position in the list.
Ex:
<ol>
<li>
Text in multiple line
</li>
</ol>
Will do :
开发者_如何转开发 1. Text in
multiple line
The '1' in the previous example is the thing that I want to position at the middle center. Is it possible. If yes, how can I do that.
I think this may be what you're 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>
Use
<ol>
<li>Text in </br>multiple line</li>
</ol>
fiddle
If your list element should come to center try this
<ol>
<li style="text-align:center;">
Text in multiple line
</li>
</ol>
精彩评论