【发布时间】:2014-05-18 17:59:21
【问题描述】:
使用 css content 属性,我试图在元素之后放置一个 HTML 实体。
这是我的 HTML:
<table id="tic" cellpadding="0" cellspacing="0" border="5" bordercolor="black" bordercolorlight="gray" bgcolor="white">
<tr>
<td width="55" height="55" class="x"></td>
<td width="55" height="55" class="o"></td>
<td width="55" height="55" class="x"></td>
</tr>
<tr>
<td width="55" height="55" class="o"></td>
<td width="55" height="55" class="x"></td>
<td width="55" height="55" class="o"></td>
</tr>
<tr>
<td width="55" height="55" class="x"></td>
<td width="55" height="55" class="o"></td>
<td width="55" height="55" class="x"></td>
</tr>
</table>
还有我的 CSS:
table{
text-align:center;
font-size:2em;
font-weight:bold;
}
td.o:after{
content:"○";
font-weight:bold;
}
td.x:after{
content:"✖"
}
不幸的是,我没有得到 ○ 字符和 ✖ 字符,而是得到了实体名称。
我该如何解决这个问题?谢谢!
【问题讨论】:
-
unicode-table.com 并使用来自@dejakob 的答案作为代码。发疯
-
你必须使用转义的 unicode.. 检查下面的 stackoverflow.. stackoverflow.com/questions/190396/…
标签: html css html-entities html-encode html-escape-characters