Style an ordered list with Cyrillic letters

前端 未结 4 911
孤独总比滥情好
孤独总比滥情好 2020-12-07 02:16

There are many possible values for list-style-type CSS property (e. g. decimal, lower-latin, upper-greek and so on). Howe

4条回答
  •  难免孤独
    2020-12-07 03:09

    In this method I'm using CSS-generated content in before each list item.

    .lower-ukrainian {
      list-style-type: none;
    }
    
    .lower-ukrainian li:before {
      display: inline-block;
      margin-left: -1.5em;
      margin-right: .55em;
      text-align: right;
      width: .95em;
    }
    
    .lower-ukrainian li:first-child:before {
      content: "а.";
    }
    
    .lower-ukrainian li:nth-child(2):before {
      content: "б.";
    }
    
    /* and so on */
    

    Disadvantages

    1. Hardcoded, restrict list to a certain max length.
    2. Not pixel-perfect as compared to a regular order list

提交回复
热议问题