What is default list styling (CSS)?

后端 未结 7 1833
挽巷
挽巷 2020-12-12 20:16

On my website I use reset.css. It adds exactly this to list styles:

ol, ul {
    list-style: none outside none;
}
html, body, div, span, applet, object, ifra         


        
7条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-12 20:43

    As per the documentation, most browsers will display the

      ,
        and
      1. elements with the following default values:

        Default CSS settings for UL or OL tag:

        ul, ol { 
            display: block;
            list-style: disc outside none;
            margin: 1em 0;
            padding: 0 0 0 40px;
        }
        ol { 
            list-style-type: decimal;
        }
        

        Default CSS settings for LI tag:

        li { 
            display: list-item;
        }
        

        Style nested list items as well:

        ul ul, ol ul {
            list-style-type: circle;
            margin-left: 15px; 
        }
        ol ol, ul ol { 
            list-style-type: lower-latin;
            margin-left: 15px; 
        }
        

        Note: The result will be perfect if we use the above styles with a class. Also see different List-Item markers.

提交回复
热议问题