Text Shadows on counter or bullet in list

半城伤御伤魂 提交于 2019-12-04 11:18:57

If you also want to set the text-shadow on the counter/bullet, you need to put the counter/bullet in the :before pseudo element so that the counter/bullet can have a text-shadow like the rest of the text.

To keep the position of the counter you can set position:absolute; to the pseudo element and position it outside the li on the left with right:100%;.

body {
    text-shadow: .1em 0.1em 0.2em;
}
ol {
    counter-reset: li;
    list-style-type: none;
}
ol li{
    position:relative;
}
ol li:before{
    content: counter(li)'.';
    counter-increment: li;
    position:absolute;
    right:100%;
    margin-right:0.5em;
}
Ordered Lists
<ol>
    <li>content</li>
    <li>content</li>
    <li>content</li>
</ol>
Collin Green

For custom styles on the list decoration themselves you probably need to either fake them or use custom images (or both).

This looks semi-helpful but doesn't have different values per item.

Custom bullet symbol for <li> elements in <ul> that is a regular character, and not an image

If you know how many items you are going to have as a maximum you could create a custom rule for each n-th child of the ul.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!