p:before { content:"\00a1"; }
但这是倒置的感叹号。我只需要正常的感叹号。有什么想法吗?
如果您想要标准字符,则不需要 unicode 代码:
p:before { content:"!"; }
Below classes are the Exclamation Mark with round red background
.dot {
height: 25px;
width: 25px;
background-color: red;
border-radius: 50%;
display: inline-block;
}
.dot:before {
content:'\0021';
}
\00a1 是反感叹号的 unicode,只需使用 content: '!'; 因为 !不是真正的“特殊”
\0021
是“正常”感叹号的 unicode。您的代码将如下所示:
p:before { content:"\0021"; }