Customize list item bullets using CSS

前端 未结 12 1228
感动是毒
感动是毒 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:03

      If you wrap your

    • content in a or other tag, you may change the font size of the
    • , which will change the size of the bullet, then reset the content of the
    • to its original size. You may use em units to resize the
    • bullet proportionally.

      For example:

      • First item
      • Second item

      Then CSS:

      li {
          list-style-type: disc;
          font-size: 0.8em;
      }
      
      li * {
          font-size: initial;
      }
      

      A more complex example:

      
      
      
          List Item Bullet Size
          
          
          
      
      
      
      

      First

      • First item
      • Second item

      Second

      • First item
      • Second item

      Results in:

    提交回复
    热议问题