【发布时间】:2020-02-08 21:37:13
【问题描述】:
在我的沙盒中:
.thunderbolt li:nth-child(1):before {content: "\26A1 ";}
.thunderbolt li:nth-child(2):before {content: "???? ";}
.thunderbolt li:nth-child(3):before {content: "???? ";}
.thunderbolt li:nth-child(4):before {content: "???? ";}
.thunderbolt li:nth-child(5):before {content: "???? ";}
.thunderbolt li:nth-child(6):before {content: "\2685";}
<div>
<ul class="thunderbolt">
<li>ThunderBolt devices only get recognized by BootCamp on boot.</li>
<li>If you unplug your ThunderBolt device while using Windows, you'll have to shut down then reboot your OS to get it recognized again.</li>
<li>Disable <b>Fast Startup </b>in Windows 8/10.</li>
<ul>
<li>Also try holding <b>Shift </b>when you click <b>Start </b>> <b>Shut down</b>.</li>
</ul>
<li>Wait a solid chunk of seconds on the login screen after boot to allow BootCamp to configure Thunderbolt devices.</li>
<li><b>Sleep </b>simply does not work in BootCamp with a ThunderBolt device connected.</li>
</ul>
</div>
我希望 unicode 字符替换项目符号点。相反,字符只是与项目符号一起显示,与文本一致。
另外,我不希望 .thunderbolt 类应用于嵌套的 <ul>--我只是希望这是一个标准的要点。
我试过.thunderbolt list-style: none,但所做的只是让我的雷电符号消失。
此外,显示的结果网页会跳过 .thunderbolt li:nth-child(4):before {content: "???? ";} 中的第 4 个孩子的字符,而是显示 .thunderbolt li:nth-child(5):before {content: "???? ";} 中的字符。似乎代码将嵌套的<li> 视为父级<ul> 中的第四个孩子。
- 我如何替换
<ul>中的要点为 unicode 字符? - 如何告诉 CSS 在应用
nth-child(n)属性时跳过嵌套的<ul>?
【问题讨论】:
-
@MrLister 对不起,我已经有一段时间没来这里了。将代码添加到帖子内容中
标签: css unicode html-lists emoji