How to center ordered list number in HTML

前端 未结 4 1441
误落风尘
误落风尘 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 17:53

    This is very old post but this this is the solution I did.

    CSS:

    .center
    {
     text-align: center;
     list-style-position: inside;
    }
    ol.center li
    {
     text-align: left;
     margin-left: 45%;
    }
    

    HTML

      Lorem ipsum dolor sit amet consectetur adipisicing elit. Reprehenderit, repellat.
    1. List1
    2. List2

    Final Result would look lke this :

提交回复
热议问题