📜 ⬆️ ⬇️

Arrangement of homemade markers in the lists

Task: make homemade markers for lists.

Using list-style-image is not always convenient due to unpredictable indents. Therefore, I used to use a type construct
ul li {
padding-left: 10px;
background: url (bullet.gif) 0 5px no-repeat;
}

Today I got the idea to improve this construction a bit by setting background to the relative position:
ul li {
padding-left: 10px;
background: url (bullet.gif) 0 0.5em no-repeat;
}


Advantages - the marker remains in place when changing the font size. Crossbrowser.
If there is a need, I can add pictures, but, in my opinion, everything is clear.

')

Source: https://habr.com/ru/post/24470/


All Articles