How to center ordered list number in HTML

前端 未结 4 1402
误落风尘
误落风尘 2021-01-07 17:15

I am currently learning HTML programming. I have a problem:

If I put like this:



HEADLINE
4条回答
  •  孤城傲影
    2021-01-07 18:03

    Nikolas, aligning the numbers on an ordered list in CSS is as follows:

         ol
        {
           display: inline-block;
           margin-left: auto;
           margin-right: auto;
        }
    

    **You must use a display-block because you need to put your list in a box for it to center the numbers with the list.

提交回复
热议问题