webkit shows bullet behind floated elements in list

后端 未结 2 575
盖世英雄少女心
盖世英雄少女心 2021-01-21 00:37

span {
  float:          


        
2条回答
  •  礼貌的吻别
    2021-01-21 01:21

    A pseudo element, with a CSS counter for ol list can be used to avoid bug and use of borders

    span {
      float: left;
      width: 200px;
    }
    ol {
      counter-reset:marker;
      }
    li {
      counter-increment:marker;
      list-style-type:none;
      box-shadow:0 2px gray;
      }
    li:before {
      content:'\02022 ';
      padding-right:0.25em;
      float:left;
      }
    ol li:before {
      content:counter(marker)'. ';
      }
    hr ~* li:before {
      text-indent:-1em;
      }
    li:after {
      content:'';
      display:table;
      clear:both;
    • test
    • test
    1. test
    2. test

    • test
    • test
    1. test
    2. test

提交回复
热议问题