Why does the list style disappear when display: block is added to a list item in a list (
    or
      )?

后端 未结 5 430
执笔经年
执笔经年 2020-12-05 13:45

This seems to valid for display: inline; and display: inline-block; too.

This is what I mean:

ul li {
  display: block;
  /         


        
5条回答
  •  不知归路
    2020-12-05 14:23

    A way to get the effect would be:

    1. desc

    CSS:

    li {
        list-style-position: inside;
        display: inline-block; /* or block */
    }
    
    li a {
        display: list-item;
        padding: 10px 20px;
    }
    

提交回复
热议问题