简体   繁体   English

更改Chrome中的项目符号颜色?

[英]Changing the bullet point color in Chrome?

It's easy to set a bullet point colour, but changing it doesn't seem to work in the latest version of Chrome (it works fine in Safari and Firefox). 设置项目符号颜色很容易,但更改它似乎不适用于最新版本的Chrome(它在Safari和Firefox中可以正常工作)。

For example hover the mouse over the elements in the code snippet: 例如,将鼠标悬停在代码段中的元素上:

  li { list-style-type: disc; list-style-position: outside; margin-left: 20px; } ul { transition: color .3s linear; color: red; } ul:hover { color: black; } 
 <ul> <li>First</li> <li>Second</li> <li>Third</li> </ul> 

Or JSFiddle (if you prefer that) 或者JSFiddle (如果你愿意的话)

You may remove all list styling and add a pseudo element which will make <li> elements look like having a disc style. 您可以删除所有列表样式并添加一个伪元素,这将使<li>元素看起来像具有光盘样式。

li {
    list-style: none;
}

li:before {
    content: '\25CF\00a0\00a0';
    display: inline;
}

Fiddle here . 在这里小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM