Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the difference between alphabetic and numeric types in the CSS symbols() function?

Can you explain me please, What is the difference between of that two types in css symbols() function? When I try separately each of them, I has’nt seen any difference, only one – numbering start from 0 and first symbol doesn’t show first in the list.

div {
  margin: 70px 70px;
}

ol {
  list-style: symbols(numeric "â—‹" "â—Ź" "â–ˇ")
}
<div>
  <ol>
    <li>item</li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
  </ol>
</div>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

For numeric, the symbols represent the digits of a number system, where the number of symbols represents the base. The list starts at 1, and when it runs out of symbols, it continues to 10.

ol {
  list-style: symbols(numeric "0" "1" "2" "3" "4" "5" "6" "7" "8" "9");
}
<div>
  <ol>
    <li>item</li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
  </ol>
</div>

For alphabetic, the list is constructed in the same way, but without the assumption that the first symbol represents 0. When the list runs out of symbols, it continues with 00 instead of 10.

ol {
  list-style: symbols(alphabetic "0" "1" "2" "3" "4" "5" "6" "7" "8" "9");
}
<div>
  <ol>
    <li>item</li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
    <li>item </li>
  </ol>
</div>

symbols() – CSS: Cascading Style Sheets | MDN

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading