Customize list item bullets using CSS

前端 未结 12 1216
感动是毒
感动是毒 2020-12-15 03:17

Is it possible to change the size of an

  • element\'s bullet?

    Take a look at the code below:

    li {
        list-sty         
    
    
            
  • 12条回答
    •  温柔的废话
      2020-12-15 04:08

      Another way of changing the size of the bullets would be:

      1. Disabling the bullets altogether
      2. Re-adding the custom bullets with the help of ::before pseudo-element.

      Example:

      ul {
        list-style-type: none;
      }
      
      li::before {
        display:          inline-block;
        vertical-align:   middle;
        width:            5px;
        height:           5px;
        background-color: #000000;
        margin-right:     8px;
        content:          ' '
      }
      • first element
      • second element

      No markup changes needed

    提交回复
    热议问题